function pixreviews_init_plugin() { global $pixreviews_plugin; $pixreviews_plugin = PixReviewsPlugin::get_instance(); }
static function option($option, $default = null) { return PixReviewsPlugin::get_option($option, $default = null); }
define('EXT', '.php'); } require 'core/bootstrap' . EXT; $config = (include 'plugin-config' . EXT); // set textdomain pixreviews::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 = dirname(__FILE__) . DIRECTORY_SEPARATOR; $callbackpath = $basepath . 'callbacks' . DIRECTORY_SEPARATOR; pixreviews::require_all($callbackpath); require_once plugin_dir_path(__FILE__) . 'class-pixreviews.php'; // Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively. register_activation_hook(__FILE__, array('PixReviewsPlugin', 'activate')); //register_deactivation_hook( __FILE__, array( 'pixreviewsPlugin', 'deactivate' ) ); global $pixreviews_plugin; $pixreviews_plugin = PixReviewsPlugin::get_instance();
/** * Return an instance of this class. * @since 1.0.0 * @return object A single instance of this class. */ public static function get_instance() { // If the single instance hasn't been set, set it now. if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }