PluginProbe
PixTypes / 2.0.2
PixTypes v2.0.2
2.0.2 trunk 1.3.5 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.16 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1
pixtypes / pixtypes.php

pixtypes.php in PixTypes 2.0.2, at pixtypes.php

65 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: PixTypes
4 * Plugin URI: https://wordpress.org/plugins/pixtypes/
5 * Description: Theme-driven post types, taxonomies & custom fields.
6 * Version: 2.0.2
7 * Author: Pixelgrade
8 * Author URI: https://pixelgrade.com
9 * Author Email: contact@pixelgrade.com
10 * Requires at least: 6.0
11 * Tested up to: 7.1
12 * Requires PHP: 7.4
13 * Text Domain: pixtypes
14 * License: GPL-2.0 or later.
15 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
16 * Domain Path: /lang
17 */
18
19 // If this file is called directly, abort.
20 if ( ! defined( 'WPINC' ) ) {
21 die;
22 }
23
24 // ensure PIXTYPES_EXT is defined
25 if ( ! defined( 'PIXTYPES_EXT' ) ) {
26 define( 'PIXTYPES_EXT', '.php' );
27 }
28
29 require 'core/bootstrap' . PIXTYPES_EXT;
30
31 $config = include 'plugin-config' . PIXTYPES_EXT;
32 // set textdomain
33 pixtypes::settextdomain( $config['textdomain'] );
34
35 // Ensure Test Data
36 // ----------------
37
38 $defaults = include 'plugin-defaults' . PIXTYPES_EXT;
39
40 $current_data = get_option( $config['settings-key'] );
41
42 if ( $current_data === false ) {
43 add_option( $config['settings-key'], $defaults );
44 } else if ( count( array_diff_key( $defaults, $current_data ) ) != 0 ) {
45 $plugindata = array_merge( $defaults, $current_data );
46 update_option( $config['settings-key'], $plugindata );
47 }
48 # else: data is available; do nothing
49
50 // Load Callbacks
51 // --------------
52
53 $basepath = trailingslashit( dirname( __FILE__ ) );
54 $callbackpath = trailingslashit( $basepath . 'callbacks' );
55 pixtypes::require_all( $callbackpath );
56
57 require_once( plugin_dir_path( __FILE__ ) . 'class-pixtypes.php' );
58
59 // Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively.
60 register_activation_hook( __FILE__, array( 'PixTypesPlugin', 'activate' ) );
61 //register_deactivation_hook( __FILE__, array( 'PixTypesPlugin', 'deactivate' ) );
62
63 global $pixtypes_plugin;
64 $pixtypes_plugin = PixTypesPlugin::get_instance( '2.0.2' );
65