← All changes
|
vendor/woocommerce/action-scheduler/deprecated/functions.php
+30
-27
1.0.1
→
trunk
View file →
| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | - | |
| 3 | 2 | /** |
| 4 | 3 | * Deprecated API functions for scheduling actions |
| 5 | 4 | * |
| 6 | 5 | * Functions with the wc prefix were deprecated to avoid confusion with |
| @@ -5,17 +4,19 @@ | ||
| 5 | 4 | * |
| 6 | 5 | * Functions with the wc prefix were deprecated to avoid confusion with |
| 7 | 6 | * Action Scheduler being included in WooCommerce core, and it providing |
| 8 | 7 | * a different set of APIs for working with the action queue. |
| 8 | + * | |
| 9 | + * @package ActionScheduler | |
| 9 | 10 | */ |
| 10 | 11 | |
| 11 | 12 | /** |
| 12 | - * Schedule an action to run one time | |
| 13 | + * Schedule an action to run one time. | |
| 13 | 14 | * |
| 14 | - * @param int $timestamp When the job will run | |
| 15 | - * @param string $hook The hook to trigger | |
| 16 | - * @param array $args Arguments to pass when the hook triggers | |
| 17 | - * @param string $group The group to assign this job to | |
| 15 | + * @param int $timestamp When the job will run. | |
| 16 | + * @param string $hook The hook to trigger. | |
| 17 | + * @param array $args Arguments to pass when the hook triggers. | |
| 18 | + * @param string $group The group to assign this job to. | |
| 18 | 19 | * |
| 19 | 20 | * @return string The job ID |
| 20 | 21 | */ |
| 21 | 22 | function wc_schedule_single_action( $timestamp, $hook, $args = array(), $group = '' ) { |
| @@ -23,15 +24,15 @@ | ||
| 23 | 24 | return as_schedule_single_action( $timestamp, $hook, $args, $group ); |
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | /** |
| 27 | - * Schedule a recurring action | |
| 28 | + * Schedule a recurring action. | |
| 28 | 29 | * |
| 29 | - * @param int $timestamp When the first instance of the job will run | |
| 30 | - * @param int $interval_in_seconds How long to wait between runs | |
| 31 | - * @param string $hook The hook to trigger | |
| 32 | - * @param array $args Arguments to pass when the hook triggers | |
| 33 | - * @param string $group The group to assign this job to | |
| 30 | + * @param int $timestamp When the first instance of the job will run. | |
| 31 | + * @param int $interval_in_seconds How long to wait between runs. | |
| 32 | + * @param string $hook The hook to trigger. | |
| 33 | + * @param array $args Arguments to pass when the hook triggers. | |
| 34 | + * @param string $group The group to assign this job to. | |
| 34 | 35 | * |
| 35 | 36 | * @deprecated 2.1.0 |
| 36 | 37 | * |
| 37 | 38 | * @return string The job ID |
| @@ -43,10 +44,10 @@ | ||
| 43 | 44 | |
| 44 | 45 | /** |
| 45 | 46 | * Schedule an action that recurs on a cron-like schedule. |
| 46 | 47 | * |
| 47 | - * @param int $timestamp The schedule will start on or after this time | |
| 48 | - * @param string $schedule A cron-link schedule string | |
| 48 | + * @param int $timestamp The schedule will start on or after this time. | |
| 49 | + * @param string $schedule A cron-link schedule string. | |
| 49 | 50 | * @see http://en.wikipedia.org/wiki/Cron |
| 50 | 51 | * * * * * * * |
| 51 | 52 | * ┬ ┬ ┬ ┬ ┬ ┬ |
| 52 | 53 | * | | | | | | |
| @@ -55,11 +56,11 @@ | ||
| 55 | 56 | * | | | +---------- month (1 - 12) |
| 56 | 57 | * | | +--------------- day of month (1 - 31) |
| 57 | 58 | * | +-------------------- hour (0 - 23) |
| 58 | 59 | * +------------------------- min (0 - 59) |
| 59 | - * @param string $hook The hook to trigger | |
| 60 | - * @param array $args Arguments to pass when the hook triggers | |
| 61 | - * @param string $group The group to assign this job to | |
| 60 | + * @param string $hook The hook to trigger. | |
| 61 | + * @param array $args Arguments to pass when the hook triggers. | |
| 62 | + * @param string $group The group to assign this job to. | |
| 62 | 63 | * |
| 63 | 64 | * @deprecated 2.1.0 |
| 64 | 65 | * |
| 65 | 66 | * @return string The job ID |
| @@ -71,11 +72,11 @@ | ||
| 71 | 72 | |
| 72 | 73 | /** |
| 73 | 74 | * Cancel the next occurrence of a job. |
| 74 | 75 | * |
| 75 | - * @param string $hook The hook that the job will trigger | |
| 76 | - * @param array $args Args that would have been passed to the job | |
| 77 | - * @param string $group | |
| 76 | + * @param string $hook The hook that the job will trigger. | |
| 77 | + * @param array $args Args that would have been passed to the job. | |
| 78 | + * @param string $group Action's group. | |
| 78 | 79 | * |
| 79 | 80 | * @deprecated 2.1.0 |
| 80 | 81 | */ |
| 81 | 82 | function wc_unschedule_action( $hook, $args = array(), $group = '' ) { |
| @@ -83,17 +84,19 @@ | ||
| 83 | 84 | as_unschedule_action( $hook, $args, $group ); |
| 84 | 85 | } |
| 85 | 86 | |
| 86 | 87 | /** |
| 87 | - * @param string $hook | |
| 88 | - * @param array $args | |
| 89 | - * @param string $group | |
| 88 | + * Get next scheduled action. | |
| 90 | 89 | * |
| 90 | + * @param string $hook Action's hook. | |
| 91 | + * @param array $args Action's args. | |
| 92 | + * @param string $group Action's group. | |
| 93 | + * | |
| 91 | 94 | * @deprecated 2.1.0 |
| 92 | 95 | * |
| 93 | 96 | * @return int|bool The timestamp for the next occurrence, or false if nothing was found |
| 94 | 97 | */ |
| 95 | -function wc_next_scheduled_action( $hook, $args = NULL, $group = '' ) { | |
| 98 | +function wc_next_scheduled_action( $hook, $args = null, $group = '' ) { | |
| 96 | 99 | _deprecated_function( __FUNCTION__, '2.1.0', 'as_next_scheduled_action()' ); |
| 97 | 100 | return as_next_scheduled_action( $hook, $args, $group ); |
| 98 | 101 | } |
| 99 | 102 | |
| @@ -99,9 +102,9 @@ | ||
| 99 | 102 | |
| 100 | 103 | /** |
| 101 | 104 | * Find scheduled actions |
| 102 | 105 | * |
| 103 | - * @param array $args Possible arguments, with their default values: | |
| 106 | + * @param array $args Possible arguments, with their default values: | |
| 104 | 107 | * 'hook' => '' - the name of the action that will be triggered |
| 105 | 108 | * 'args' => NULL - the args array that will be passed with the action |
| 106 | 109 | * 'date' => NULL - the scheduled date of the action. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime(). Used in UTC timezone. |
| 107 | 110 | * 'date_compare' => '<=' - operator for testing "date". accepted values are '!=', '>', '>=', '<', '<=', '=' |
| @@ -112,10 +115,10 @@ | ||
| 112 | 115 | * 'claimed' => NULL - TRUE to find claimed actions, FALSE to find unclaimed actions, a string to find a specific claim ID |
| 113 | 116 | * 'per_page' => 5 - Number of results to return |
| 114 | 117 | * 'offset' => 0 |
| 115 | 118 | * 'orderby' => 'date' - accepted values are 'hook', 'group', 'modified', or 'date' |
| 116 | - * 'order' => 'ASC' | |
| 117 | - * @param string $return_format OBJECT, ARRAY_A, or ids | |
| 119 | + * 'order' => 'ASC'. | |
| 120 | + * @param string $return_format OBJECT, ARRAY_A, or ids. | |
| 118 | 121 | * |
| 119 | 122 | * @deprecated 2.1.0 |
| 120 | 123 | * |
| 121 | 124 | * @return array |