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

PHP wp_get_schedules函数代码示例

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

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



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

示例1: setSections

 public function setSections()
 {
     //---- Theme Option Here ----//
     $schedules = array();
     $wp_get_schedules = function_exists('wp_get_schedules') ? wp_get_schedules() : null;
     if (is_array($wp_get_schedules) && !empty($wp_get_schedules)) {
         foreach ($wp_get_schedules as $key => $value) {
             $schedules[$key] = $value['display'];
         }
     }
     // General settings
     $this->sections[] = array('title' => __('General', 'gazeta'), 'icon' => 'el-icon-website', 'desc' => null, 'fields' => array(array('id' => 'favicon', 'type' => 'media', 'url' => true, 'preview' => false, 'subtitle' => __('Upload any media using the WordPress native uploader', 'gazeta'), 'title' => __('Favicon', 'gazeta')), array('id' => 'sidebar', 'type' => 'image_select', 'title' => __('Blog Layout', 'gazeta'), 'options' => array('left-sidebar' => array('alt' => __('Left Sidebar', 'gazeta'), 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'), 'right-sidebar' => array('alt' => __('Right Sidebar', 'gazeta'), 'img' => ReduxFramework::$_url . 'assets/img/2cr.png')), 'default' => 'right-sidebar', 'description' => __('Set the layout of the blog/category/archive/author/tag/search page, not for static page.', 'gazeta')), array('id' => 'transient', 'type' => 'checkbox', 'title' => __('Enable Transient', 'gazeta'), 'description' => __('Caching the Widget/Shortcode', 'gazeta'), 'default' => '0'), array('id' => 'transient_expiration', 'type' => 'text', 'title' => __('Transient Expiration', 'gazeta'), 'subtitle' => __('Set/update the expiration value of the transients.', 'gazeta'), 'validate' => 'numeric', 'description' => __('Time until expiration in seconds from now, or 0 for never expires. Ex: For one day, the expiration value would be: (60 * 60 * 24), all widgets and shortcodes will be cached with expiration is 300 seconds (mean is 5 minutes), you can set this value in the widget or the shortcode with the various values, example: <strong>[shortcode expiration="600"]</strong> or enter a general value in this option, this will effect to all Widgets and Shortcodes.', 'gazeta'), 'required' => array('transient', "=", '1')), array('id' => '404-page', 'type' => 'select', 'data' => 'pages', 'title' => __('404 Page', 'gazeta'), 'subtitle' => __('Choose the 404 Error Page.', 'gazeta'), 'description' => __('Or leave blank for default.', 'gazeta')), array('id' => 'viewing', 'type' => 'switch', 'title' => __('Viewing', 'gazeta'), 'subtitle' => __('Activating Post Viewing feature.', 'gazeta'), 'description' => __('On/Off will display/hide the View count number, this feature require Jetpack\'s Stats feature activated.', 'gazeta'), 'default' => 1), array('id' => 'custom_css', 'type' => 'ace_editor', 'title' => __('Custom CSS', 'gazeta'), 'subtitle' => __('Paste your CSS code here, no style tag.', 'gazeta'), 'mode' => 'css', 'theme' => 'monokai'), array('id' => 'custom_css_mobile', 'type' => 'ace_editor', 'title' => __('Mobile Custom CSS', 'gazeta'), 'subtitle' => __('Paste your CSS code here, no style tag, this CSS will effect to the site on Mobile.', 'gazeta'), 'mode' => 'css', 'theme' => 'monokai'), array('id' => 'custom_js', 'type' => 'ace_editor', 'title' => __('Custom JS', 'gazeta'), 'subtitle' => __('Paste your JS code here, no script tag, eg: alert(\'hello world\');', 'gazeta'), 'mode' => 'javascript', 'theme' => 'chrome'), array('id' => 'custom_js_mobile', 'type' => 'ace_editor', 'title' => __('Mobile Custom JS', 'gazeta'), 'subtitle' => __('Paste your JS code here, no script tag, this JS will effect to the site on Mobile eg: alert(\'hello world\');', 'gazeta'), 'mode' => 'javascript', 'theme' => 'chrome')));
     // Styling.
     $this->sections[] = array('title' => __('Styling', 'gazeta'), 'icon' => 'el-icon-th-list', 'desc' => null, 'fields' => array(array('id' => 'body', 'type' => 'typography', 'title' => __('Body', 'gazeta'), 'font-size' => false, 'color' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('body'), 'compiler' => array('body'), 'units' => 'px', 'default' => array('font-family' => 'Raleway', 'google' => true)), array('id' => 'menu', 'type' => 'typography', 'title' => __('Menu Item', 'gazeta'), 'font-size' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('header nav ul li a'), 'compiler' => array('header nav ul li a'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading', 'type' => 'typography', 'title' => __('Heading', 'gazeta'), 'font-size' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h1,h2,h3,h4,h5,h6'), 'compiler' => array('h1,h2,h3,h4,h5,h6'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading1', 'type' => 'typography', 'title' => __('Heading 1', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h1'), 'compiler' => array('h1'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading2', 'type' => 'typography', 'title' => __('Heading 2', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h2'), 'compiler' => array('h2'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading3', 'type' => 'typography', 'title' => __('Heading 3', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h3'), 'compiler' => array('h3'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading4', 'type' => 'typography', 'title' => __('Heading 4', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h4'), 'compiler' => array('h4'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading5', 'type' => 'typography', 'title' => __('Heading 5', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h5'), 'compiler' => array('h5'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'heading6', 'type' => 'typography', 'title' => __('Heading 6', 'gazeta'), 'color' => false, 'font-family' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('h6'), 'compiler' => array('h6'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'entry-title', 'type' => 'typography', 'title' => __('Entry Title', 'gazeta'), 'font-size' => false, 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('.entry-title, .entry-title a, .post-title a'), 'compiler' => array('.entry-title, .entry-title a, .post-title a'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'entry-content', 'type' => 'typography', 'title' => __('Entry Content', 'gazeta'), 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('div.entry-content p, p.entry-content'), 'compiler' => array('div.entry-content p, p.entry-content'), 'units' => 'px', 'default' => array('font-family' => 'Arial', 'google' => true)), array('id' => 'widget-heading-font', 'type' => 'typography', 'title' => __('Widget Heading Font', 'gazeta'), 'font-weight' => false, 'font-style' => false, 'subsets' => false, 'google' => true, 'subsets' => false, 'font-backup' => false, 'text-align' => false, 'line-height' => false, 'all_styles' => true, 'output' => array('.side-widget h5 span'), 'compiler' => array('.side-widget h5 span'), 'units' => 'px', 'default' => array('font-family' => 'Oswald', 'google' => true)), array('id' => 'widget_heading_wrapper_bg', 'type' => 'background', 'output' => array('.side-widget h5'), 'title' => __('Widget Wrapper Background', 'saturn'), 'subtitle' => __('Pick a background color for the Widget Heading.', 'saturn'), 'background-repeat' => false, 'background-attachment' => false, 'background-position' => false, 'background-image' => false, 'background-size' => false), array('id' => 'widget_heading_inner_bg', 'type' => 'background', 'output' => array('.side-widget h5 span'), 'title' => __('Widget Inner Background', 'saturn'), 'subtitle' => __('Pick a background color for the Widget Heading.', 'saturn'), 'background-repeat' => false, 'background-attachment' => false, 'background-position' => false, 'background-image' => false, 'background-size' => false), array('id' => 'widget_heading_color', 'type' => 'color', 'output' => array('.side-widget h5 span'), 'title' => __('Widget Heading Color', 'saturn'), 'subtitle' => __('Pick a color for the Widget Heading (default: #fff).', 'saturn'), 'validate' => 'color')));
     $header_field = array();
     $header_field[] = array('id' => 'top_bar', 'type' => 'checkbox', 'title' => __('Shows the Top Bar', 'gazeta'), 'default' => '1');
     $header_field[] = array('id' => 'header_current_time', 'type' => 'checkbox', 'title' => __('Current Datetime', 'gazeta'), 'subtitle' => __('Display current datetime', 'gazeta'), 'default' => '1');
     $header_field[] = array('id' => 'header_current_time_format', 'type' => 'text', 'title' => __('Datetime Format', 'gazeta'), 'subtitle' => __('Formatting Date and Time', 'gazeta'), 'description' => sprintf(__('Check <strong>%s</strong> for more info.', 'gazeta'), '<a href="http://codex.wordpress.org/Formatting_Date_and_Time">' . __('HERE', 'gazeta') . '</a>'), 'default' => 'l, F j, Y');
     $header_field[] = array('id' => 'header_weather', 'type' => 'checkbox', 'title' => __('Weather', 'gazeta'), 'subtitle' => __('Display the Weather Informations', 'gazeta'), 'default' => '0');
     $header_field[] = array('id' => 'header_weather_apikey', 'type' => 'text', 'title' => __('Wunderground API Key', 'gazeta'), 'subtitle' => __('A paid service of Wunderground.com', 'gazeta'), 'description' => sprintf(__('This Key can be found at %s, You would need to signup and register a key, <i>This featured may not work properly for some locations.</i>', 'gazeta'), '<a href="http://www.wunderground.com/weather/api/">' . __('HERE', 'gazeta') . '</a>'), 'required' => array('header_weather', "=", '1'));
     $header_field[] = array('id' => 'header_weather_location', 'type' => 'text', 'title' => __('Location', 'gazeta'), 'subtitle' => __('Getting this location\'s weather information', 'gazeta'), 'description' => sprintf(__('Or leave blank for getting visitor\'s location, the location is based on the IP address, here is %s', 'gazeta'), '<a target="_blank" href="http://ipinfo.io/">' . __('yours', 'gazeta') . '</a>'), 'required' => array('header_weather', "=", '1'));
     $header_field[] = array('id' => 'header_weather_expiration', 'type' => 'text', 'title' => __('Transient Expiration', 'gazeta'), 'subtitle' => __('Set/update the expiration value of the transients.', 'gazeta'), 'default' => 1200, 'required' => array('header_weather', "=", '1'));
     $socials_field = function_exists('gazeta_user_contactmethods') ? gazeta_user_contactmethods(array()) : '';
     if (is_array($socials_field)) {
         foreach ($socials_field as $key => $value) {
             $header_field[] = array('id' => 'header_social_' . $key, 'type' => 'text', 'title' => $value, 'subtitle' => sprintf(__('%s Profile Url', 'gazeta'), $value));
         }
     }
     // Header.
     $this->sections[] = array('title' => __('Header', 'gazeta'), 'icon' => 'el-icon-wrench', 'desc' => null, 'fields' => apply_filters('gazeta_theme_options/header_field_args', $header_field));
     // Footer.
     $this->sections[] = array('title' => __('Footer', 'gazeta'), 'icon' => 'el-icon-wrench', 'desc' => null, 'fields' => array(array('id' => 'footer-columns', 'type' => 'text', 'title' => __('Footer\'s Columns', 'gazeta'), 'subtitle' => __('Setting the Footer\'s widget columns.', 'gazeta'), 'validate' => 'numeric', 'default' => '4'), array('id' => 'credits', 'type' => 'textarea', 'title' => __('Footer Text', 'gazeta'), 'subtitle' => __('HTML Allowed', 'gazeta'), 'validate' => 'html', 'default' => sprintf(__('Copyright &copy; 2014 %s', 'gazeta'), get_bloginfo('name')))));
 }
开发者ID:alvarpoon,项目名称:get-it-write,代码行数:33,代码来源:theme-options.php


示例2: add

	public static function add( $hook, $recurrence, $args = array() ) {
		$args      = array_slice( func_get_args(), 2 );
		$schedules = wp_get_schedules();
		if ( isset( $schedules[$recurrence] ) && ( $current = $schedules[$recurrence] ) ) {
			return wp_schedule_event( time() + $current['interval'], $recurrence, $hook, $args );
		}
	}
开发者ID:jknowles94,项目名称:Work-examples,代码行数:7,代码来源:class-ai1wm-cron.php


示例3: schedule_cron

 function schedule_cron()
 {
     if (false === wp_next_scheduled('do_scheduled_async_scan')) {
         $schedules = wp_get_schedules();
         wp_schedule_event(time() + $schedules['vip-scanner-interval']['interval'], 'vip-scanner-interval', 'do_scheduled_async_scan');
     }
 }
开发者ID:grappler,项目名称:vip-scanner,代码行数:7,代码来源:vip-scanner-async.php


示例4: create_auto_cache_timeout

 public function create_auto_cache_timeout($recurrance, $interval)
 {
     $exist_cronjob = false;
     $wpfc_timeout_number = 0;
     $crons = _get_cron_array();
     foreach ((array) $crons as $cron_key => $cron_value) {
         foreach ((array) $cron_value as $hook => $events) {
             if (preg_match("/^wp\\_fastest\\_cache(.*)/", $hook, $id)) {
                 if (!$id[1] || preg_match("/^\\_(\\d+)\$/", $id[1])) {
                     $wpfc_timeout_number++;
                     foreach ((array) $events as $event_key => $event) {
                         $schedules = wp_get_schedules();
                         if (isset($event["args"]) && isset($event["args"][0])) {
                             if ($event["args"][0] == '{"prefix":"all","content":"all"}') {
                                 if ($schedules[$event["schedule"]]["interval"] <= $interval) {
                                     $exist_cronjob = true;
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!$exist_cronjob) {
         $args = array("prefix" => "all", "content" => "all");
         wp_schedule_event(time(), $recurrance, "wp_fastest_cache_" . $wpfc_timeout_number, array(json_encode($args)));
     }
 }
开发者ID:pcuervo,项目名称:onnis-luque,代码行数:29,代码来源:admin.php


示例5: registerCronTask

 /**
  * Register a cron task
  * @param string $cronActionName The name of the action that will be registered with wp-cron
  * @param string $callback The function to register with wp-cron
  * @param string $interval can only be one of the following: hourly, daily and twicedaily if no other custom intervals are registered. Defaults to daily
  * @return void
  */
 public static function registerCronTask($cronActionName, $callback, $interval = 'daily')
 {
     if (!is_callable($callback)) {
         return;
     }
     // if cron disabled -> run callback
     if (!self::canRegisterCronTask()) {
         self::registerTask($callback);
         return;
     }
     $interval = strtolower($interval);
     if (empty($interval)) {
         $interval = 'daily';
     } else {
         // check to see if the time interval is valid
         $timeIntervals = wp_get_schedules();
         if (!array_key_exists($interval, $timeIntervals)) {
             $interval = 'daily';
         }
     }
     // avoid duplicate crons
     add_action($cronActionName, $callback);
     if (!wp_next_scheduled($cronActionName)) {
         wp_schedule_event(time(), $interval, $cronActionName);
         array_push(self::$_cronTasks, $cronActionName);
     }
 }
开发者ID:yarwalker,项目名称:ecobyt,代码行数:34,代码来源:WsdScheduler.php


示例6: checkCronSetup

 /**
  * Checks Cron setup, validates schedules, and reschedules events if necessary.
  *
  * @attaches-to `init` hook.
  *
  * @since 151220 Improving WP Cron setup and validation of schedules
  */
 public function checkCronSetup()
 {
     if (!get_transient('doing_cron') && $this->options['crons_setup'] < 1439005906 || $this->options['crons_setup_on_namespace'] !== __NAMESPACE__ || $this->options['crons_setup_with_cache_cleanup_schedule'] !== $this->options['cache_cleanup_schedule'] || $this->options['crons_setup_on_wp_with_schedules'] !== sha1(serialize(wp_get_schedules())) || !wp_next_scheduled('_cron_' . GLOBAL_NS . '_cleanup')) {
         wp_clear_scheduled_hook('_cron_' . GLOBAL_NS . '_cleanup');
         wp_schedule_event(time() + 60, $this->options['cache_cleanup_schedule'], '_cron_' . GLOBAL_NS . '_cleanup');
         $this->updateOptions(['crons_setup' => time(), 'crons_setup_on_namespace' => __NAMESPACE__, 'crons_setup_with_cache_cleanup_schedule' => $this->options['cache_cleanup_schedule'], 'crons_setup_on_wp_with_schedules' => sha1(serialize(wp_get_schedules()))]);
     }
 }
开发者ID:arobbins,项目名称:sblog,代码行数:15,代码来源:CronUtils.php


示例7: vidtrial_schedule_freq

 public function vidtrial_schedule_freq($val)
 {
     $schedules = wp_get_schedules();
     $valid = '"' . implode(', ', array_keys($schedules)) . '"';
     if (!array_key_exists($val, $schedules)) {
         throw new ValidationError(sprintf(__("Schedule must be one of the following: %s.", VIDTRIAL_TD), $valid));
     }
     return $val;
 }
开发者ID:ajenta,项目名称:vidtrial,代码行数:9,代码来源:admin.php


示例8: schedule_event

 /**
  * Schedule the cron. The unschedule method is called to cancel the cron previously scheduled
  * and reschedule it if the interval has been changed
  *
  * @since 1.0
  */
 public function schedule_event()
 {
     $option = get_option('social_archiver');
     $interval = isset($option['twitter_cron_interval']) ? esc_attr($option['twitter_cron_interval']) : 'hourly';
     $schedules = wp_get_schedules();
     if (!isset($schedules[$interval])) {
         return;
     }
     $this->unschedule_event();
     wp_schedule_event(time() + $schedules[$interval]['interval'], $interval, self::$event_name);
 }
开发者ID:gallib,项目名称:social-archiver,代码行数:17,代码来源:TwitterCron.php


示例9: prettyCronInterval

 public static function prettyCronInterval($interval)
 {
     $schedule_intervals = wp_get_schedules();
     foreach ($schedule_intervals as $interval_tag => $schedule_interval) {
         if ($interval == $schedule_interval['interval']) {
             return array($interval_tag, $schedule_interval['display']);
         }
     }
     return false;
     // Not found.
 }
开发者ID:AgilData,项目名称:WordPress-Skeleton,代码行数:11,代码来源:core.php


示例10: schedule_internal_events

 /**
  * Schedule internal jobs
  */
 public function schedule_internal_events()
 {
     $when = strtotime(sprintf('+%d seconds', JOB_QUEUE_WINDOW_IN_SECONDS));
     $schedules = wp_get_schedules();
     foreach ($this->internal_jobs as $job_args) {
         if (!wp_next_scheduled($job_args['action'])) {
             $interval = array_key_exists($job_args['schedule'], $schedules) ? $schedules[$job_args['schedule']]['interval'] : 0;
             $args = array('schedule' => $job_args['schedule'], 'args' => array(), 'interval' => $interval);
             Cron_Options_CPT::instance()->create_or_update_job($when, $job_args['action'], $args);
         }
     }
 }
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:15,代码来源:class-internal-events.php


示例11: schedule_recurring_event

function schedule_recurring_event($event)
{
    global $wpdb;
    $schedules = wp_get_schedules();
    $schedule = $event->schedule;
    $job = new Job();
    $job->hook = $event->hook;
    $job->site = get_current_blog_id();
    $job->start = $job->nextrun = $event->timestamp;
    $job->interval = $event->interval;
    $job->args = $event->args;
    $job->save();
}
开发者ID:outsourceappz,项目名称:Cavalcade,代码行数:13,代码来源:connector.php


示例12: getAllSchedules

 /**
  * @return array
  */
 public static function getAllSchedules()
 {
     if (self::$_allSchedules === null) {
         $result = array();
         if (function_exists('wp_get_schedules')) {
             foreach (wp_get_schedules() as $k => $v) {
                 $result[$k] = $v['display'];
             }
         }
         self::$_allSchedules = $result;
     }
     return self::$_allSchedules;
 }
开发者ID:jasmun,项目名称:Noco100,代码行数:16,代码来源:Cron.php


示例13: spa_get_cron_data

function spa_get_cron_data()
{
    $data = new stdClass();
    $data->cron = _get_cron_array();
    foreach ($data->cron as $time => $hooks) {
        foreach ($hooks as $hook => $items) {
            foreach ($items as $key => $item) {
                $data->cron[$time][$hook][$key]['date'] = date_i18n(SFDATES, $time) . ' - ' . date_i18n(SFTIMES, $time);
            }
        }
    }
    $data->schedules = wp_get_schedules();
    return $data;
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:14,代码来源:spa-toolbox-prepare.php


示例14: alo_em_check_cron_scheduled

/**
 * To fix missing cron schedules
 */
function alo_em_check_cron_scheduled()
{
    if (!wp_next_scheduled('alo_em_batch')) {
        wp_schedule_event(time() + 60, 'alo_em_interval', 'alo_em_batch');
    }
    if (!wp_next_scheduled('alo_em_schedule')) {
        wp_schedule_event(time(), 'twicedaily', 'alo_em_schedule');
    }
    // Schedule bounce events, if bounce schedule key exists
    if (array_key_exists('alo_em_bounce', wp_get_schedules())) {
        if (!wp_next_scheduled('alo_em_bounce_handle')) {
            wp_schedule_event(time() + 60, 'alo_em_bounce', 'alo_em_bounce_handle');
        }
    }
}
开发者ID:dcotet,项目名称:alo-easymail,代码行数:18,代码来源:alo-easymail-schedule.php


示例15: kt_cron_schedules_metabox_callback

function kt_cron_schedules_metabox_callback()
{
    $schedules = wp_get_schedules();
    if (KT::arrayIssetAndNotEmpty($schedules)) {
        echo "<ol>";
        foreach ($schedules as $key => $values) {
            if (KT::arrayIssetAndNotEmpty($values)) {
                $interval = KT::arrayTryGetValue($values, "interval");
                $display = KT::arrayTryGetValue($values, "display");
                echo "<li><b>{$key}</b> (<i>{$display}</i>) - {$interval} [s]</li>";
            }
        }
        echo "</ol>";
    }
}
开发者ID:ktstudio,项目名称:wp-framework,代码行数:15,代码来源:kt_wp_cron_metabox.admin.inc.php


示例16: reschedule

 public function reschedule()
 {
     // NOTE
     // If cron previously registered was not in here
     // it will not be unscheduled now, but next time
     // it will be fired.
     foreach (array_keys($this->get_cron_job_list()) as $cron_id) {
         $this->unschedule($cron_id);
         $schedule_id = $this->backup()->settings()->get_cron_schedule($cron_id);
         $schedules = wp_get_schedules();
         if (isset($schedules[$schedule_id])) {
             $schedule_interval = $schedules[$schedule_id]['interval'];
             $completed_at = $this->backup()->settings()->get_cron_completed_at($cron_id);
             // First time backup should be made right now. Then each time an interval was passed.
             wp_schedule_event(max($completed_at + $schedule_interval, time()), $schedule_id, 'fw_backup_cron', array($cron_id));
         }
     }
 }
开发者ID:chrisuehlein,项目名称:couponsite,代码行数:18,代码来源:class-fw-backup-cron.php


示例17: register_scheduled_task

 /**
  * Runs upon plugin activation, registering our scheduled task used to process
  * batches of pending import record inserts/updates.
  */
 public function register_scheduled_task()
 {
     $schedules = wp_get_schedules();
     if (wp_next_scheduled(self::$scheduled_key)) {
         return;
     }
     /**
      * Filter the interval at which to process import records.
      *
      * By default a custom interval of ever 30mins is specified, however
      * other intervals such as "hourly", "twicedaily" and "daily" can
      * normally be substituted.
      *
      * @see wp_schedule_event()
      * @see 'cron_schedules'
      */
     $interval = apply_filters('tribe_aggregator_record_processor_interval', 'tribe-every15mins');
     wp_schedule_event(time(), $interval, self::$scheduled_key);
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:23,代码来源:Queue_Processor.php


示例18: list_crons

 /**
  * List out all of the crons that can be run.
  *
  * ## EXAMPLES
  *
  * wp videopress list_crons
  */
 public function list_crons()
 {
     $scheduler = VideoPress_Scheduler::init();
     $crons = $scheduler->get_crons();
     $schedules = wp_get_schedules();
     if (count($crons) === 0) {
         WP_CLI::success(__('Found no available cron jobs.', 'jetpack'));
     } elseif (count($crons) === 1) {
         WP_CLI::success(__('Found 1 available cron job.', 'jetpack'));
     } else {
         WP_CLI::success(sprintf(__('Found %d available cron jobs.', 'jetpack'), count($crons)));
     }
     foreach ($crons as $cron_name => $cron) {
         $interval = isset($schedules[$cron['interval']]['display']) ? $schedules[$cron['interval']]['display'] : $cron['interval'];
         $runs_next = $scheduler->check_cron($cron_name);
         $status = $runs_next ? sprintf('Scheduled - Runs Next at %s GMT', gmdate('Y-m-d H:i:s', $runs_next)) : 'Not Scheduled';
         WP_CLI::log('Name: ' . $cron_name);
         WP_CLI::log('Method: ' . $cron['method']);
         WP_CLI::log('Interval: ' . $interval);
         WP_CLI::log('Status: ' . $status);
     }
 }
开发者ID:automattic,项目名称:jetpack,代码行数:29,代码来源:class.videopress-cli.php


示例19: create

 /**
  * Create transient cache with background updates
  *
  * @param string $key unique transient key
  * @param callable $callback update function
  * @param string $recurrence how often the cache should be updated, default is 'hourly'
  *
  * @throws WpException
  */
 public static function create($key, $callback, $recurrence = 'hourly')
 {
     $key = sanitize_key($key);
     if (empty($key)) {
         throw new WpException('Invalid Transient key');
     }
     if (!Action::is_callable($callback)) {
         throw new WpException('Invalid Transient callback');
     }
     $schedules = wp_get_schedules();
     if (!isset($schedules[$recurrence])) {
         throw new WpException('Invalid Transient recurrence');
     }
     $cron_action_key = static::_get_cron_action_key($key);
     add_action($cron_action_key, function () use($key, $callback) {
         $value = Action::execute($callback);
         set_transient($key, $value, 0);
     });
     if (!wp_next_scheduled($cron_action_key)) {
         wp_schedule_event(time(), $recurrence, $cron_action_key);
     }
 }
开发者ID:redink-no,项目名称:wpkit,代码行数:31,代码来源:Transient.php


示例20: admin_init

 public function admin_init()
 {
     add_filter(sprintf('pre_update_option_%s', 'orbis_timesheets_email_frequency'), array($this, 'update_option_frequency'), 10, 2);
     // E-mail
     add_settings_section('orbis_timesheets_settings_general', __('General Settings', 'orbis_timesheets'), '__return_false', 'orbis_timesheets_settings');
     add_settings_field('orbis_timesheets_registration_limit_lower', __('Registration Limit Lower', 'orbis_timesheets'), array($this, 'input_select'), 'orbis_timesheets_settings', 'orbis_timesheets_settings_general', array('label_for' => 'orbis_timesheets_registration_limit_lower', 'options' => array('0' => __('None', 'orbis_timesheets'), '1 day' => __('1 Day', 'orbis_timesheets'), '3 days' => __('3 Days', 'orbis_timesheets'), '1 week' => __('1 Week', 'orbis_timesheets'), '1 month' => __('1 Month', 'orbis_timesheets'))));
     register_setting('orbis_timesheets', 'orbis_timesheets_registration_limit_lower');
     // E-mail
     add_settings_section('orbis_timesheets_settings_email', __('E-mail Settings', 'orbis_timesheets'), '__return_false', 'orbis_timesheets_settings');
     $options = array('');
     foreach (wp_get_schedules() as $name => $schedule) {
         $options[$name] = $schedule['display'];
     }
     add_settings_field('orbis_timesheets_email_frequency', __('Frequency', 'orbis_timesheets'), array($this, 'input_select'), 'orbis_timesheets_settings', 'orbis_timesheets_settings_email', array('label_for' => 'orbis_timesheets_email_frequency', 'options' => $options));
     add_settings_field('orbis_timesheets_email_time', __('Time', 'orbis_timesheets'), array($this, 'input_text'), 'orbis_timesheets_settings', 'orbis_timesheets_settings_email', array('label_for' => 'orbis_timesheets_email_time', 'classes' => array()));
     add_settings_field('orbis_timesheets_emails_next_schedule', __('Next Schedule', 'orbis_timesheets'), array($this, 'next_schedule'), 'orbis_timesheets_settings', 'orbis_timesheets_settings_email');
     add_settings_field('orbis_timesheets_email_subject', __('Subject', 'orbis_timesheets'), array($this, 'input_text'), 'orbis_timesheets_settings', 'orbis_timesheets_settings_email', array('label_for' => 'orbis_timesheets_email_subject'));
     add_settings_field('orbis_timesheets_email_manually', __('E-mail Manually', 'orbis_timesheets'), array($this, 'button_email_manually'), 'orbis_timesheets_settings', 'orbis_timesheets_settings_email', array('label_for' => 'orbis_timesheets_email_subject'));
     register_setting('orbis_timesheets', 'orbis_timesheets_email_frequency');
     register_setting('orbis_timesheets', 'orbis_timesheets_email_time');
     register_setting('orbis_timesheets', 'orbis_timesheets_email_subject');
 }
开发者ID:joffcrabtree,项目名称:wp-orbis-timesheets,代码行数:22,代码来源:orbis-timesheets-admin.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wp_get_server_protocol函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_get_schedule函数代码示例发布时间: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