-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpixtypes.php
More file actions
64 lines (51 loc) · 1.87 KB
/
pixtypes.php
File metadata and controls
64 lines (51 loc) · 1.87 KB
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
64
<?php
/**
* Plugin Name: PixTypes
* Plugin URI: https://wordpress.org/plugins/pixtypes/
* Description: Theme-driven post types, taxonomies & custom fields.
* Version: 2.0.0
* Author: Pixelgrade
* Author URI: https://pixelgrade.com
* Author Email: contact@pixelgrade.com
* Requires at least: 6.0
* Tested up to: 6.7
* Requires PHP: 7.4
* 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 PIXTYPES_EXT is defined
if ( ! defined( 'PIXTYPES_EXT' ) ) {
define( 'PIXTYPES_EXT', '.php' );
}
require 'core/bootstrap' . PIXTYPES_EXT;
$config = include 'plugin-config' . PIXTYPES_EXT;
// set textdomain
pixtypes::settextdomain( $config['textdomain'] );
// Ensure Test Data
// ----------------
$defaults = include 'plugin-defaults' . PIXTYPES_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( '2.0.0' );