wp_next_scheduled

函式
wp_next_scheduled ( $hook, $args = array() )
引數
  • (string) $hook Action hook of the event.
    Required:
  • (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. Default empty array.
    Required:
    Default: array()
返回值
  • (int|false) The Unix timestamp of the next time the event will occur. False if the event doesn't exist.
定義位置
相關方法
wp_get_schedulewp_get_scheduleswp_get_scheduled_eventwp_clear_scheduled_hookwp_unschedule_hook
引入
2.1.0
棄用
-

wp_next_scheduled: 這個函式用來檢索一個特定鉤子的下一個預定事件的時間戳。它可以用來確定預定事件何時發生,或根據預定事件執行行動。

檢索一個事件的下一個時間戳。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_next_scheduled( $hook, $args = array() ) {
$next_event = wp_get_scheduled_event( $hook, $args );
if ( ! $next_event ) {
return false;
}
return $next_event->timestamp;
}
function wp_next_scheduled( $hook, $args = array() ) { $next_event = wp_get_scheduled_event( $hook, $args ); if ( ! $next_event ) { return false; } return $next_event->timestamp; }
function wp_next_scheduled( $hook, $args = array() ) {
	$next_event = wp_get_scheduled_event( $hook, $args );
	if ( ! $next_event ) {
		return false;
	}

	return $next_event->timestamp;
}

常見問題

FAQs
檢視更多 >