wp_get_schedule
函数
wp_get_schedule ( $hook, $args = array() )
- 参数
-
-
(string)
$hook
Action hook to identify the event.- Required: 是
-
(array)
$args
Optional. Arguments passed to the event’s callback function. Default empty array.- Required: 否
- Default: array()
-
(string)
- 返回值
-
- (string|false) Schedule name on success, false if no schedule.
- 相关
-
- wp_get_schedules()
- 定义位置
-
-
wp-includes/cron.php
, line 1078
-
wp-includes/cron.php
- 引入
- 2.1.0
- 弃用
- –
Retrieve the recurrence schedule for an event.
function wp_get_schedule( $hook, $args = array() ) {
$schedule = false;
$event = wp_get_scheduled_event( $hook, $args );
if ( $event ) {
$schedule = $event->schedule;
}
/**
* Filters the schedule for a hook.
*
* @since 5.1.0
*
* @param string|false $schedule Schedule for the hook. False if not found.
* @param string $hook Action hook to execute when cron is run.
* @param array $args Arguments to pass to the hook's callback function.
*/
return apply_filters( 'get_schedule', $schedule, $hook, $args );
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


