function pixreviews_init_plugin()
{
    global $pixreviews_plugin;
    $pixreviews_plugin = PixReviewsPlugin::get_instance();
}
Beispiel #2
0
    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();