• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_get_schedule函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_get_schedule函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_get_schedule函数的具体用法?PHP wp_get_schedule怎么用?PHP wp_get_schedule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_get_schedule函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: schedule_omnibar_update

 public function schedule_omnibar_update()
 {
     if (!wp_get_schedule('idx_omnibar_get_locations')) {
         //refresh omnibar fields once a day
         wp_schedule_event(time(), 'daily', 'idx_omnibar_get_locations');
     }
 }
开发者ID:jdelia,项目名称:wordpress-plugin,代码行数:7,代码来源:initiate-plugin.php


示例2: init

 /**
  * things to run within WordPress init
  */
 public function init()
 {
     if (!wp_get_schedule(static::schedule)) {
         wp_schedule_event(time(), static::schedule, static::schedule);
     }
     return false;
 }
开发者ID:petermolnar,项目名称:blogroll2email,代码行数:10,代码来源:blogroll2email.php


示例3: cp_schedule_expire_check

function cp_schedule_expire_check()
{
    global $cp_options;
    $recurrance = $cp_options->ad_expired_check_recurrance;
    if (empty($recurrance)) {
        $recurrance = 'daily';
    }
    // clear schedule if prune ads disabled or recurrance set to none
    if (!$cp_options->post_prune || $recurrance == 'none') {
        if (wp_next_scheduled('cp_ad_expired_check')) {
            wp_clear_scheduled_hook('cp_ad_expired_check');
        }
        return;
    }
    // set schedule if does not exist
    if (!wp_next_scheduled('cp_ad_expired_check')) {
        wp_schedule_event(time(), $recurrance, 'cp_ad_expired_check');
        return;
    }
    // re-schedule if settings changed
    $schedule = wp_get_schedule('cp_ad_expired_check');
    if ($schedule && $schedule != $recurrance) {
        wp_clear_scheduled_hook('cp_ad_expired_check');
        wp_schedule_event(time(), $recurrance, 'cp_ad_expired_check');
    }
}
开发者ID:TopLineMediaTeam,项目名称:horseshow,代码行数:26,代码来源:cron.php


示例4: test_deleteOldAlertsIsScheduledAndUnscheduled

 public function test_deleteOldAlertsIsScheduledAndUnscheduled()
 {
     $this->plugin->activate();
     $this->assertEquals('twicedaily', wp_get_schedule('better-angels_delete_old_alerts'));
     $this->plugin->deactivate();
     $this->assertFalse(wp_get_schedule('better-angels_delete_old_alerts'));
 }
开发者ID:adagaria,项目名称:better-angels,代码行数:7,代码来源:test-alerts.php


示例5: hook_init

 function hook_init()
 {
     if (!defined('NEWSLETTER_EXTENSION_UPDATE') || NEWSLETTER_EXTENSION_UPDATE) {
         add_filter('site_transient_update_plugins', array($this, 'hook_site_transient_update_plugins'));
         add_filter('pre_set_site_transient_update_plugins', array($this, 'hook_pre_set_site_transient_update_plugins'));
     } else {
         add_filter('site_transient_update_plugins', array($this, 'hook_site_transient_update_plugins_disable'));
     }
     if ($this->options['enabled'] == 1) {
         add_action('newsletter_mandrill_bounce', array($this, 'bounce'));
         if ($this->options['api'] == 1) {
             if (method_exists('Newsletter', 'register_mail_method')) {
                 Newsletter::instance()->register_mail_method(array($this, 'mail'));
             }
         } else {
             add_filter('newsletter_smtp', array($this, 'hook_newsletter_smtp'));
         }
     }
     if (is_admin()) {
         add_action('admin_init', array($this, 'hook_admin_init'));
         add_action('admin_menu', array($this, 'hook_admin_menu'), 100);
         if (isset($_GET['page']) && strpos($_GET['page'], $this->slug . '/') === 0) {
             wp_enqueue_script('jquery-ui-tabs');
             wp_enqueue_style($this->prefix . '_css', plugin_dir_url(__FILE__) . '/admin.css');
         }
         if (!defined('DOING_CRON') || !DOING_CRON) {
             if (wp_get_schedule('newsletter_mandrill_bounce') === false) {
                 wp_schedule_event(time() + 60, 'daily', 'newsletter_mandrill_bounce');
             }
         }
         //            add_filter('plugin_install_action_links', array($this, 'hook_plugin_install_action_links'), 100, 2);
     }
 }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:33,代码来源:mandrill.php


示例6: test_schedule_and_unschedule_delete_old_alerts_hook_on_activation_and_deactivation

 /**
  * Checks (de)activating the plugin (un)schedules "old" alerts for
  * deletion.
  *
  * It is important for Buoy alerts to be ephemeral in nature, not
  * necessarily stored in a database for a long time. This test is
  * used to make sure that merely activating the plugin is enough
  * to tell the plugin to delete any incident data that was made
  * 48 hours ago (or longer).
  *
  * This test also checks for the inverse: that this scheduled job
  * is automatically removed whenever the plugin is deactivated.
  *
  * Note that this test does *not* ensure the alert data itself is
  * deleted, only that the automatic job scheduler has the correct
  * information.
  *
  * @ticket 21
  */
 public function test_schedule_and_unschedule_delete_old_alerts_hook_on_activation_and_deactivation()
 {
     WP_Buoy_Plugin::activate();
     $this->assertEquals('hourly', wp_get_schedule('buoy_delete_old_alerts', array('-2 days')));
     WP_Buoy_Plugin::deactivate();
     $this->assertFalse(wp_get_schedule('buoy_delete_old_alerts', array('-2 days')));
 }
开发者ID:vincentshadow,项目名称:better-angels,代码行数:26,代码来源:test-alerts.php


示例7: scheduleProcessComments

 public function scheduleProcessComments()
 {
     $options = get_option($this->prefix . 'settings');
     if (!wp_get_schedule($this->prefix . 'process') && 1 === $options['use_txs_polling']) {
         wp_schedule_event(time(), 'hourly', $this->prefix . 'process');
     }
 }
开发者ID:meitar,项目名称:my-two-cents,代码行数:7,代码来源:my-two-cents.php


示例8: initialisePlugin

 public static function initialisePlugin()
 {
     // NB Network activation will not upgrade a site
     // do upgrade will check current upgrade script version and apply as necessary
     upgrader::checkUpgrade();
     // 2 is required for $file to be populated
     add_filter('plugin_row_meta', array(__CLASS__, 'filter_plugin_row_meta'), 10, 2);
     add_action('do_robots', array(__CLASS__, 'addRobotLinks'), 100, 0);
     add_action('wp_head', array(__CLASS__, 'addRssLink'), 100);
     // only include admin files when necessary.
     if (is_admin()) {
         include_once 'settings.php';
         include_once 'postMetaData.php';
         include_once 'categoryMetaData.php';
         settings::addHooks();
         categoryMetaData::addHooks();
         postMetaData::addHooks();
     }
     if (!wp_get_schedule('xmsg_ping')) {
         // ping in 2 hours from when setup.
         wp_schedule_event(time() + 60 * 60 * 2, 'daily', 'xmsg_ping');
     }
     add_action('xmsg_ping', array(__CLASS__, 'doPing'));
     // NB Network activation will not have set up the rules for the site.
     // Check if they exist and then reactivate.
     if (get_option(RULES_OPTION_NAME, null) != RULES_VERSION) {
         add_action('wp_loaded', array(__CLASS__, 'activateRewriteRules'), 99999, 1);
     }
 }
开发者ID:wistel,项目名称:wordpress,代码行数:29,代码来源:core.php


示例9: Enable

 /**
  * Enabled the sitemap plugin with registering all required hooks
  *
  * @uses add_action Adds actions for admin menu, executing pings and handling robots.txt
  * @uses add_filter Adds filtes for admin menu icon and contexual help
  * @uses GoogleSitemapGeneratorLoader::SetupRewriteHooks() Registeres the rewrite hooks
  * @uses GoogleSitemapGeneratorLoader::CallShowPingResult() Shows the ping result on request
  * @uses GoogleSitemapGeneratorLoader::ActivateRewrite() Writes rewrite rules the first time
  */
 public static function Enable()
 {
     //Register the sitemap creator to wordpress...
     add_action('admin_menu', array(__CLASS__, 'RegisterAdminPage'));
     //Nice icon for Admin Menu (requires Ozh Admin Drop Down Plugin)
     add_filter('ozh_adminmenu_icon', array(__CLASS__, 'RegisterAdminIcon'));
     //Additional links on the plugin page
     add_filter('plugin_row_meta', array(__CLASS__, 'RegisterPluginLinks'), 10, 2);
     //Listen to ping request
     add_action('sm_ping', array(__CLASS__, 'CallSendPing'), 10, 1);
     //Listen to daily ping
     add_action('sm_ping_daily', array(__CLASS__, 'CallSendPingDaily'), 10, 1);
     //Existing page was published
     add_action('publish_post', array(__CLASS__, 'SchedulePing'), 999, 1);
     add_action('publish_page', array(__CLASS__, 'SchedulePing'), 9999, 1);
     add_action('delete_post', array(__CLASS__, 'SchedulePing'), 9999, 1);
     //Robots.txt request
     add_action('do_robots', array(__CLASS__, 'CallDoRobots'), 100, 0);
     //Help topics for context sensitive help
     //add_filter('contextual_help_list', array(__CLASS__, 'CallHtmlShowHelpList'), 9999, 2);
     //Check if the result of a ping request should be shown
     if (!empty($_GET["sm_ping_service"])) {
         self::CallShowPingResult();
     }
     //Fix rewrite rules if not already done on activation hook. This happens on network activation for example.
     if (get_option("sm_rewrite_done", null) != self::$svnVersion) {
         add_action('wp_loaded', array(__CLASS__, 'ActivateRewrite'), 9999, 1);
     }
     //Schedule daily ping
     if (!wp_get_schedule('sm_ping_daily')) {
         wp_schedule_event(time() + 60 * 60, 'daily', 'sm_ping_daily');
     }
 }
开发者ID:rongandat,项目名称:best-picture,代码行数:42,代码来源:sitemap-loader.php


示例10: get_transient

 /**
  * Get the data from the transient and/or schedule new data to be retrieved.
  *
  * @param	string	$transient	The name of the transient. Must be 43 characters or less including $this->transient_prefix.
  * @param	string	$hook		The name of the hook to retrieve new data.
  * @param	array	$args		An array of arguments to pass to the function.
  *
  * @return	mixed	Either false or the data from the transient.
  */
 public function get_transient($transient, $hook, $args)
 {
     // Build the transient names.
     $transient = $this->prefix . $transient;
     $fallback_transient = $transient . '_';
     if (is_multisite()) {
         if (false === ($data = get_site_transient($transient))) {
             $data = get_site_transient($fallback_transient);
             if (!wp_get_schedule($hook, $args)) {
                 wp_clear_scheduled_hook($hook, $args);
                 wp_schedule_single_event(time(), $hook, $args);
             }
             return $data;
         } else {
             return $data;
         }
     } else {
         if (false === ($data = get_transient($transient))) {
             $data = get_transient($fallback_transient);
             if (!wp_get_schedule($hook, $args)) {
                 wp_clear_scheduled_hook($hook, $args);
                 wp_schedule_single_event(time(), $hook, $args);
             }
             return $data;
         } else {
             return $data;
         }
     }
 }
开发者ID:firetreedesign,项目名称:ccbpress-core,代码行数:38,代码来源:class-ccbpress-transients.php


示例11: get_schedule

 public function get_schedule($cron_id)
 {
     $a = wp_get_schedule('fw_backup_cron', array($cron_id));
     if ($a === false) {
         return 'disabled';
     }
     return $a;
 }
开发者ID:chrisuehlein,项目名称:couponsite,代码行数:8,代码来源:class-fw-backup-cron.php


示例12: init

 public function init()
 {
     // get_pung is not restrictive enough
     //add_filter ( 'get_pung', array( &$this, 'get_pung' ) );
     if (!wp_get_schedule(static::cron)) {
         wp_schedule_event(time(), static::cron, static::cron);
     }
 }
开发者ID:petermolnar,项目名称:wp-webmention-again,代码行数:8,代码来源:sender.php


示例13: feature_on

 public function feature_on()
 {
     // Already scheduled
     if (false !== wp_get_schedule(self::CRON_NAME)) {
         return;
     }
     // Schedule cron for this plugin.
     wp_schedule_event(time(), 'daily', self::CRON_NAME);
 }
开发者ID:hiromaki,项目名称:wordpress_blog,代码行数:9,代码来源:siteguard-updates-notify.php


示例14: bpsPro_schedule_DBB_checks

function bpsPro_schedule_DBB_checks()
{
    $bpsDBBCronCheck = wp_get_schedule('bpsPro_DBB_check');
    $DBBoptions = get_option('bulletproof_security_options_db_backup');
    $clock = mktime(date("H", time()), 0, 0, date("n", time()), date("j", time()), date("Y", time()));
    if ($DBBoptions['bps_db_backup'] == 'On') {
        if (!wp_next_scheduled('bpsPro_DBB_check')) {
            wp_schedule_event($clock, 'hourly', 'bpsPro_DBB_check');
        }
    }
}
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:11,代码来源:db-security.php


示例15: _wpr_schedule_crons_initial

function _wpr_schedule_crons_initial()
{
    $cron_schedules = $GLOBALS['wpr_cron_schedules'];
    foreach ($cron_schedules as $cron) {
        if (false == wp_get_schedule($cron['action'], $cron['arguments'])) {
            if (count($cron['arguments']) > 0) {
                wp_schedule_event(time() + 300, $cron['schedule'], $cron['action'], $cron['arguments']);
            } else {
                wp_schedule_event(time() + 300, $cron['schedule'], $cron['action']);
            }
        }
    }
}
开发者ID:anirut,项目名称:wp-autoresponder,代码行数:13,代码来源:cron.php


示例16: reschedule

 static function reschedule()
 {
     global $ym_crons_that_exist;
     foreach ($ym_crons_that_exist as $cron_job) {
         if ($cron_job['core'] != 2 && wp_get_schedule($cron_job['task'])) {
             // reschedule
             wp_clear_scheduled_hook($cron_job['task']);
             $now = time();
             $next = mktime($cron_job['time'][0], $cron_job['time'][1], 0, date('n', $now), date('j', $now), date('Y', $now));
             // next, schedule, action_name
             wp_schedule_event($next, $cron_job['schedule'], $cron_job['task']);
         }
     }
 }
开发者ID:AdultStack,项目名称:ap-members,代码行数:14,代码来源:ym-cron.include.php


示例17: clear_cache_for_timber_init

function clear_cache_for_timber_init()
{
    if (!is_super_admin() || !is_admin_bar_showing() || !class_exists('Timber') || !\Timber::$cache) {
        return;
    }
    //Check if user disable cron task and remove cron task
    if (defined('CLEAR_CACHE_FOR_TIMBER_DISABLE_CRON_JOB_CLEANUP') and CLEAR_CACHE_FOR_TIMBER_DISABLE_CRON_JOB_CLEANUP === true) {
        clear_cache_for_timber_remove_cron_task();
    } else {
        if (wp_get_schedule('clear_cache_for_timber_cron_task') === false) {
            clear_cache_for_timber_add_cron_task();
        }
    }
}
开发者ID:ogrosko,项目名称:clear-cache-for-timber,代码行数:14,代码来源:clear-cache-for-timber.php


示例18: _wpr_schedule_crons_initial

function _wpr_schedule_crons_initial()
{
    $cron_schedules = $GLOBALS['wpr_cron_schedules'];
    foreach ($cron_schedules as $cron) {
        if (false == wp_get_schedule($cron['action'], $cron['arguments'])) {
            if (count($cron['arguments']) > 0) {
                //check if the cron has already been scheduled
                wp_schedule_event(time(), $cron['schedule'], $cron['action'], $cron['arguments']);
            } else {
                wp_schedule_event(time(), $cron['schedule'], $cron['action']);
            }
        }
    }
}
开发者ID:rpiket,项目名称:WP-Autoresponder,代码行数:14,代码来源:cron.php


示例19: test_schedule_event_args

 function test_schedule_event_args()
 {
     // schedule an event and make sure it's returned by wp_next_scheduled
     $hook = rand_str();
     $timestamp = strtotime('+1 hour');
     $recur = 'hourly';
     $args = array(rand_str());
     wp_schedule_event($timestamp, 'hourly', $hook, $args);
     // this returns the timestamp only if we provide matching args
     $this->assertEquals($timestamp, wp_next_scheduled($hook, $args));
     // these don't match so return nothing
     $this->assertEquals(false, wp_next_scheduled($hook));
     $this->assertEquals(false, wp_next_scheduled($hook, array(rand_str())));
     $this->assertEquals($recur, wp_get_schedule($hook, $args));
 }
开发者ID:boonebgorges,项目名称:wp,代码行数:15,代码来源:cron.php


示例20: ao_cachechecker_setup

function ao_cachechecker_setup()
{
    $doCacheCheck = (bool) apply_filters('autoptimize_filter_cachecheck_do', true);
    $cacheCheckSchedule = wp_get_schedule('ao_cachechecker');
    if (!$cacheCheckSchedule && $doCacheCheck) {
        $AOCCfreq = apply_filters('autoptimize_filter_cachecheck_frequency', 'daily');
        if (!in_array($AOCCfreq, array('hourly', 'daily', 'monthly'))) {
            $AOCCfreq = 'daily';
        }
        wp_schedule_event(time(), $AOCCfreq, 'ao_cachechecker');
    } else {
        if ($cacheCheckSchedule && !$doCacheCheck) {
            wp_clear_scheduled_hook('ao_cachechecker');
        }
    }
}
开发者ID:gonzomir,项目名称:autoptimize,代码行数:16,代码来源:autoptimizeCacheChecker.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_get_schedules函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_get_rss_charset函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap