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