当前位置: 首页>>代码示例>>PHP>>正文


PHP BackWPup_Admin::get_instance方法代码示例

本文整理汇总了PHP中BackWPup_Admin::get_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP BackWPup_Admin::get_instance方法的具体用法?PHP BackWPup_Admin::get_instance怎么用?PHP BackWPup_Admin::get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BackWPup_Admin的用法示例。


在下文中一共展示了BackWPup_Admin::get_instance方法的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');
     }
 }
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:49,代码来源:backwpup.php

示例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'));
     //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 && method_exists('WP_CLI', 'add_command')) {
         WP_CLI::add_command('backwpup', 'BackWPup_WP_CLI');
     }
 }
开发者ID:isrealconsulting,项目名称:site,代码行数:47,代码来源:backwpup.php


注:本文中的BackWPup_Admin::get_instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。