Beispiel #1
0
/**
 * Plugin setup
 *
 * @return null
 */
function hmbkp_actions()
{
    $plugin_data = get_plugin_data(__FILE__);
    define('HMBKP_VERSION', $plugin_data['Version']);
    load_plugin_textdomain('hmbkp', false, HMBKP_PLUGIN_SLUG . '/languages/');
    // Fire the update action
    if (HMBKP_VERSION > get_option('hmbkp_plugin_version')) {
        hmbkp_update();
    }
    // Load admin css and js
    if (isset($_GET['page']) && $_GET['page'] == HMBKP_PLUGIN_SLUG) {
        wp_enqueue_script('hmbkp', HMBKP_PLUGIN_URL . '/assets/hmbkp.js');
        wp_enqueue_style('hmbkp', HMBKP_PLUGIN_URL . '/assets/hmbkp.css');
    }
    // Handle any advanced option changes
    hmbkp_constant_changes();
}
 /**
  * Determine if we need to run an upgrade routine.
  */
 public function upgrade()
 {
     // Fire the update action
     if (self::PLUGIN_VERSION != get_option('hmbkp_plugin_version')) {
         hmbkp_update();
     }
 }
/**
 * Plugin setup
 *
 * @return null
 */
function hmbkp_init()
{
    $plugin_data = get_plugin_data(__FILE__);
    // define the plugin version
    define('HMBKP_VERSION', $plugin_data['Version']);
    // Fire the update action
    if (HMBKP_VERSION != get_option('hmbkp_plugin_version')) {
        hmbkp_update();
    }
}
/**
 * Plugin setup
 *
 * @return null
 */
function hmbkp_init()
{
    $plugin_data = get_plugin_data(__FILE__);
    // define the plugin version
    define('HMBKP_VERSION', $plugin_data['Version']);
    // Fire the update action
    if (HMBKP_VERSION != get_option('hmbkp_plugin_version')) {
        hmbkp_update();
    }
    $schedules = HMBKP_Schedules::get_instance()->get_schedules();
    foreach ($schedules as $schedule) {
        if (!$schedule->is_filesize_cached()) {
            $task = new HM_Backdrop_TASK(array($schedule, 'get_filesize'));
            $task->schedule();
        }
    }
}