[ Index ] |
PHP Cross Reference of BuddyPress |
[Source view] [Print] [Project Stats]
WordPress CRON API
File Size: | 402 lines (12 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
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. 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. since: 2.1.0 |
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(). return: bool|null False on failure, null when complete with scheduling event. 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. since: 2.1.0 |
wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() X-Ref |
Reschedule a recurring event. return: bool|null False on failure. Null when event is rescheduled. 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. since: 2.1.0 |
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. 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. since: 2.1.0 |
wp_clear_scheduled_hook( $hook, $args = array() X-Ref |
Unschedule all cron jobs attached to a specific hook. 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. since: 2.1.0 |
wp_next_scheduled( $hook, $args = array() X-Ref |
Retrieve the next timestamp for a cron event. return: bool|int The UNIX timestamp of the next time the scheduled event will occur. param: string $hook Action hook to execute when cron is run. param: array $args Optional. Arguments to pass to the hook's callback function. since: 2.1.0 |
spawn_cron( $local_time = 0 ) X-Ref |
Send request to run cron through HTTP request that doesn't halt page loading. return: null Cron could not be spawned, because it is not needed to run. since: 2.1.0 |
wp_cron() X-Ref |
Run scheduled callbacks or spawn cron for all scheduled events. return: null When doesn't need to run Cron. since: 2.1.0 |
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> return: array since: 2.1.0 |
wp_get_schedule($hook, $args = array() X-Ref |
Retrieve Cron schedule for hook with arguments. return: string|bool False, if no schedule. Schedule on success. param: string $hook Action hook to execute when cron is run. param: array $args Optional. Arguments to pass to the hook's callback function. since: 2.1.0 |
_get_cron_array() X-Ref |
Retrieve cron info array option. return: array CRON info array. since: 2.1.0 |
_set_cron_array($cron) X-Ref |
Updates the CRON option with the new CRON array. param: array $cron Cron info array from {@link _get_cron_array()}. since: 2.1.0 |
_upgrade_cron_array($cron) X-Ref |
Upgrade a Cron info array. This function upgrades the Cron info array to version 2. return: array An upgraded Cron info array. param: array $cron Cron info array from {@link _get_cron_array()}. since: 2.1.0 |
check_server_timer( $local_time ) X-Ref |
No description |
Generated: Thu Nov 21 01:00:57 2024 | Cross-referenced by PHPXref 0.7.1 |