| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: PixTypes |
| 4 |
* Plugin URI: https://wordpress.org/plugins/pixtypes/ |
| 5 |
* Description: Custom post types and meta-boxes needed by your themes. |
| 6 |
* Version: 1.4.10 |
| 7 |
* Author URI: https://pixelgrade.com |
| 8 |
* Author Email: hello@pixelgrade.com |
| 9 |
* License: GPL2+ |
| 10 |
* Text Domain: pixtypes |
| 11 |
* Domain Path: /lang/ |
| 12 |
*/ |
| 13 |
|
| 14 |
// If this file is called directly, abort. |
| 15 |
if ( ! defined( 'WPINC' ) ) { |
| 16 |
die; |
| 17 |
} |
| 18 |
|
| 19 |
// ensure EXT is defined |
| 20 |
if ( ! defined( 'EXT' ) ) { |
| 21 |
define( 'EXT', '.php' ); |
| 22 |
} |
| 23 |
|
| 24 |
require 'core/bootstrap' . EXT; |
| 25 |
|
| 26 |
$config = include 'plugin-config' . EXT; |
| 27 |
// set textdomain |
| 28 |
pixtypes::settextdomain( $config['textdomain'] ); |
| 29 |
|
| 30 |
// Ensure Test Data |
| 31 |
// ---------------- |
| 32 |
|
| 33 |
$defaults = include 'plugin-defaults' . EXT; |
| 34 |
|
| 35 |
$current_data = get_option( $config['settings-key'] ); |
| 36 |
|
| 37 |
if ( $current_data === false ) { |
| 38 |
add_option( $config['settings-key'], $defaults ); |
| 39 |
} else if ( count( array_diff_key( $defaults, $current_data ) ) != 0 ) { |
| 40 |
$plugindata = array_merge( $defaults, $current_data ); |
| 41 |
update_option( $config['settings-key'], $plugindata ); |
| 42 |
} |
| 43 |
# else: data is available; do nothing |
| 44 |
|
| 45 |
// Load Callbacks |
| 46 |
// -------------- |
| 47 |
|
| 48 |
$basepath = trailingslashit( dirname( __FILE__ ) ); |
| 49 |
$callbackpath = trailingslashit( $basepath . 'callbacks' ); |
| 50 |
pixtypes::require_all( $callbackpath ); |
| 51 |
|
| 52 |
require_once( plugin_dir_path( __FILE__ ) . 'class-pixtypes.php' ); |
| 53 |
|
| 54 |
// Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively. |
| 55 |
register_activation_hook( __FILE__, array( 'PixTypesPlugin', 'activate' ) ); |
| 56 |
//register_deactivation_hook( __FILE__, array( 'PixTypesPlugin', 'deactivate' ) ); |
| 57 |
|
| 58 |
global $pixtypes_plugin; |
| 59 |
$pixtypes_plugin = PixTypesPlugin::get_instance( '1.4.10' ); |
| 60 |
|