[ Index ]

PHP Cross Reference of BackPress

title

Body

[close]

/includes/ -> functions.wp-cron.php (summary)

WordPress CRON API

File Size: 402 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 14 functions

  wp_schedule_single_event()
  wp_schedule_event()
  wp_reschedule_event()
  wp_unschedule_event()
  wp_clear_scheduled_hook()
  wp_next_scheduled()
  spawn_cron()
  wp_cron()
  wp_get_schedules()
  wp_get_schedule()
  _get_cron_array()
  _set_cron_array()
  _upgrade_cron_array()
  check_server_timer()

Functions
Functions that are not part of a class:

wp_schedule_single_event( $timestamp, $hook, $args = array()   X-Ref
Schedules a hook to run only once.

Schedules a hook which will be executed once by the WordPress actions core at
a time which you specify. The action will fire off when someone visits your
WordPress site, if the schedule time has passed.

since: 2.1.0
param: int $timestamp Timestamp for when to run the event.
param: string $hook Action hook to execute when cron is run.
param: array $args Optional. Arguments to pass to the hook's callback function.

wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()   X-Ref
Schedule a periodic event.

Schedules a hook which will be executed by the WordPress actions core on a
specific interval, specified by you. The action will trigger when someone
visits your WordPress site, if the scheduled time has passed.

Valid values for the recurrence are hourly, daily and twicedaily.  These can
be extended using the cron_schedules filter in wp_get_schedules().

since: 2.1.0
param: int $timestamp Timestamp for when to run the event.
param: string $recurrence How often the event should recur.
param: string $hook Action hook to execute when cron is run.
param: array $args Optional. Arguments to pass to the hook's callback function.
return: bool|null False on failure, null when complete with scheduling event.

wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()   X-Ref
Reschedule a recurring event.

since: 2.1.0
param: int $timestamp Timestamp for when to run the event.
param: string $recurrence How often the event should recur.
param: string $hook Action hook to execute when cron is run.
param: array $args Optional. Arguments to pass to the hook's callback function.
return: bool|null False on failure. Null when event is rescheduled.

wp_unschedule_event( $timestamp, $hook, $args = array()   X-Ref
Unschedule a previously scheduled cron job.

The $timestamp and $hook parameters are required, so that the event can be
identified.

since: 2.1.0
param: int $timestamp Timestamp for when to run the event.
param: string $hook Action hook, the execution of which will be unscheduled.
param: array $args Arguments to pass to the hook's callback function.

wp_clear_scheduled_hook( $hook, $args = array()   X-Ref
Unschedule all cron jobs attached to a specific hook.

since: 2.1.0
param: string $hook Action hook, the execution of which will be unscheduled.
param: array $args Optional. Arguments that were to be pass to the hook's callback function.

wp_next_scheduled( $hook, $args = array()   X-Ref
Retrieve the next timestamp for a cron event.

since: 2.1.0
param: string $hook Action hook to execute when cron is run.
param: array $args Optional. Arguments to pass to the hook's callback function.
return: bool|int The UNIX timestamp of the next time the scheduled event will occur.

spawn_cron( $local_time = 0 )   X-Ref
Send request to run cron through HTTP request that doesn't halt page loading.

since: 2.1.0
return: null Cron could not be spawned, because it is not needed to run.

wp_cron()   X-Ref
Run scheduled callbacks or spawn cron for all scheduled events.

since: 2.1.0
return: null When doesn't need to run Cron.

wp_get_schedules()   X-Ref
Retrieve supported and filtered Cron recurrences.

The supported recurrences are 'hourly' and 'daily'. A plugin may add more by
hooking into the 'cron_schedules' filter. The filter accepts an array of
arrays. The outer array has a key that is the name of the schedule or for
example 'weekly'. The value is an array with two keys, one is 'interval' and
the other is 'display'.

The 'interval' is a number in seconds of when the cron job should run. So for
'hourly', the time is 3600 or 60*60. For weekly, the value would be
60*60*24*7 or 604800. The value of 'interval' would then be 604800.

The 'display' is the description. For the 'weekly' key, the 'display' would
be <code>__('Once Weekly')</code>.

For your plugin, you will be passed an array. you can easily add your
schedule by doing the following.
<code>
// filter parameter variable name is 'array'
$array['weekly'] = array(
'interval' => 604800,
'display' => __('Once Weekly')
);
</code>

since: 2.1.0
return: array

wp_get_schedule($hook, $args = array()   X-Ref
Retrieve Cron schedule for hook with arguments.

since: 2.1.0
param: string $hook Action hook to execute when cron is run.
param: array $args Optional. Arguments to pass to the hook's callback function.
return: string|bool False, if no schedule. Schedule on success.

_get_cron_array()   X-Ref
Retrieve cron info array option.

since: 2.1.0
return: array CRON info array.

_set_cron_array($cron)   X-Ref
Updates the CRON option with the new CRON array.

since: 2.1.0
param: array $cron Cron info array from {@link _get_cron_array()}.

_upgrade_cron_array($cron)   X-Ref
Upgrade a Cron info array.

This function upgrades the Cron info array to version 2.

since: 2.1.0
param: array $cron Cron info array from {@link _get_cron_array()}.
return: array An upgraded Cron info array.

check_server_timer( $local_time )   X-Ref
No description



Generated: Wed Dec 19 01:01:51 2018 Cross-referenced by PHPXref 0.7.1