Cron API: Improve the inline documentation for the args passed to the cron event scheduling functions.

Props chadreitsma, peterwilsoncc

Fixes #51605

Built from https://develop.svn.wordpress.org/trunk@49357


git-svn-id: http://core.svn.wordpress.org/trunk@49117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2020-10-28 18:37:07 +00:00
parent e569358678
commit 1aafbf6c6f
2 changed files with 20 additions and 7 deletions

View File

@ -28,7 +28,10 @@
* *
* @param int $timestamp Unix timestamp (UTC) for when to next run the event. * @param int $timestamp Unix timestamp (UTC) for when to next run the event.
* @param string $hook Action hook to execute when the event is run. * @param string $hook Action hook to execute when the event is run.
* @param array $args Optional. Array containing each separate argument to pass to the hook's callback function. * @param array $args Optional. Array containing arguments to pass to the
* hook's callback function. Each value in the array is passed
* to the callback as an individual parameter. The array keys
* are ignored. Default: empty array.
* @return bool True if event successfully scheduled. False for failure. * @return bool True if event successfully scheduled. False for failure.
*/ */
function wp_schedule_single_event( $timestamp, $hook, $args = array() ) { function wp_schedule_single_event( $timestamp, $hook, $args = array() ) {
@ -180,9 +183,13 @@ function wp_schedule_single_event( $timestamp, $hook, $args = array() ) {
* @link https://developer.wordpress.org/reference/functions/wp_schedule_event/ * @link https://developer.wordpress.org/reference/functions/wp_schedule_event/
* *
* @param int $timestamp Unix timestamp (UTC) for when to next run the event. * @param int $timestamp Unix timestamp (UTC) for when to next run the event.
* @param string $recurrence How often the event should subsequently recur. See wp_get_schedules() for accepted values. * @param string $recurrence How often the event should subsequently recur.
* See wp_get_schedules() for accepted values.
* @param string $hook Action hook to execute when the event is run. * @param string $hook Action hook to execute when the event is run.
* @param array $args Optional. Array containing each separate argument to pass to the hook's callback function. * @param array $args Optional. Array containing arguments to pass to the
* hook's callback function. Each value in the array is passed
* to the callback as an individual parameter. The array keys
* are ignored. Default: empty array.
* @return bool True if event successfully scheduled. False for failure. * @return bool True if event successfully scheduled. False for failure.
*/ */
function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) { function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
@ -245,9 +252,13 @@ function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
* {@see 'pre_reschedule_event'} filter added to short-circuit the function. * {@see 'pre_reschedule_event'} filter added to short-circuit the function.
* *
* @param int $timestamp Unix timestamp (UTC) for when the event was scheduled. * @param int $timestamp Unix timestamp (UTC) for when the event was scheduled.
* @param string $recurrence How often the event should subsequently recur. See wp_get_schedules() for accepted values. * @param string $recurrence How often the event should subsequently recur.
* See wp_get_schedules() for accepted values.
* @param string $hook Action hook to execute when the event is run. * @param string $hook Action hook to execute when the event is run.
* @param array $args Optional. Array containing each separate argument to pass to the hook's callback function. * @param array $args Optional. Array containing arguments to pass to the
* hook's callback function. Each value in the array is passed
* to the callback as an individual parameter. The array keys
* are ignored. Default: empty array.
* @return bool True if event successfully rescheduled. False for failure. * @return bool True if event successfully rescheduled. False for failure.
*/ */
function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) { function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) {
@ -392,7 +403,9 @@ function wp_unschedule_event( $timestamp, $hook, $args = array() ) {
* {@see 'pre_clear_scheduled_hook'} filter added to short-circuit the function. * {@see 'pre_clear_scheduled_hook'} filter added to short-circuit the function.
* *
* @param string $hook Action hook, the execution of which will be unscheduled. * @param string $hook Action hook, the execution of which will be unscheduled.
* @param array $args Optional. Arguments that were to be passed to the hook's callback function. * @param array $args Optional. Array containing each separate argument to pass to the hook's callback function.
* Although not passed to a callback, these arguments are used to uniquely identify the
* event, so they should be the same as those used when originally scheduling the event.
* @return int|false On success an integer indicating number of events unscheduled (0 indicates no * @return int|false On success an integer indicating number of events unscheduled (0 indicates no
* events were registered with the hook and arguments combination), false if * events were registered with the hook and arguments combination), false if
* unscheduling one or more events fail. * unscheduling one or more events fail.

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6-beta2-49355'; $wp_version = '5.6-beta2-49357';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.