本文整理汇总了PHP中BackWPup_Job::disable_caches方法的典型用法代码示例。如果您正苦于以下问题:PHP BackWPup_Job::disable_caches方法的具体用法?PHP BackWPup_Job::disable_caches怎么用?PHP BackWPup_Job::disable_caches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BackWPup_Job
的用法示例。
在下文中一共展示了BackWPup_Job::disable_caches方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Set needed filters and actions and load
*/
private function __construct()
{
// Nothing else matters if we're not on the main site
if (!is_main_site()) {
return;
}
//auto loader
spl_autoload_register(array($this, 'autoloader'));
//start upgrade if needed
if (get_site_option('backwpup_version') != self::get_plugin_data('Version')) {
BackWPup_Install::activate();
}
//load pro features
if (class_exists('BackWPup_Pro')) {
BackWPup_Pro::get_instance();
}
//WP-Cron
if (defined('DOING_CRON') && DOING_CRON) {
if (!empty($_GET['backwpup_run']) && class_exists('BackWPup_Job')) {
//early disable caches
BackWPup_Job::disable_caches();
//add action for running jobs in wp-cron.php
add_action('wp_loaded', array('BackWPup_Cron', 'cron_active'), PHP_INT_MAX);
} else {
//add cron actions
add_action('backwpup_cron', array('BackWPup_Cron', 'run'));
add_action('backwpup_check_cleanup', array('BackWPup_Cron', 'check_cleanup'));
}
//if in cron the rest is not needed
return;
}
//deactivation hook
register_deactivation_hook(__FILE__, array('BackWPup_Install', 'deactivate'));
//Admin bar
if (get_site_option('backwpup_cfg_showadminbar', FALSE)) {
add_action('init', array('BackWPup_Adminbar', 'get_instance'));
}
//only in backend
if (is_admin() && class_exists('BackWPup_Admin')) {
BackWPup_Admin::get_instance();
}
//work with wp-cli
if (defined('WP_CLI') && WP_CLI && method_exists('WP_CLI', 'add_command')) {
WP_CLI::add_command('backwpup', 'BackWPup_WP_CLI');
}
}
示例2: __construct
/**
* Set needed filters and actions and load
*/
private function __construct()
{
// Nothing else matters if we're not on the main site
if (!is_main_site()) {
return;
}
//auto loader
spl_autoload_register(array($this, 'autoloader'));
//Options
new BackWPup_Option();
//start upgrade if needed
if (get_site_option('backwpup_version') != self::get_plugin_data('Version')) {
BackWPup_Install::activate();
}
//load pro features
if (class_exists('BackWPup_Pro')) {
BackWPup_Pro::get_instance();
}
//WP-Cron
if (defined('DOING_CRON') && DOING_CRON) {
//early disable caches
if (!empty($_GET['backwpup_run']) && class_exists('BackWPup_Job')) {
BackWPup_Job::disable_caches();
}
// add normal cron actions
add_action('backwpup_cron', array('BackWPup_Cron', 'run'));
add_action('backwpup_check_cleanup', array('BackWPup_Cron', 'check_cleanup'));
// add action for doing thinks if cron active
// must done in int before wp-cron control
add_action('init', array('BackWPup_Cron', 'cron_active'), 1);
// if in cron the rest must not needed
return;
}
//deactivation hook
register_deactivation_hook(__FILE__, array('BackWPup_Install', 'deactivate'));
//Things that must do in plugin init
add_action('init', array($this, 'plugin_init'));
//only in backend
if (is_admin() && class_exists('BackWPup_Admin')) {
BackWPup_Admin::get_instance();
}
//work with wp-cli
if (defined('WP_CLI') && WP_CLI && class_exists('WP_CLI') && class_exists('BackWPup_WP_CLI')) {
WP_CLI::addCommand('backwpup', 'BackWPup_WP_CLI');
}
}