WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

as_next_scheduled_action() WC 1.0

Check if there is an existing action in the queue with a given hook, args and group combination.

An action in the queue could be pending, in-progress or async. If the is pending for a time in future, its scheduled date will be returned as a timestamp. If it is currently being run, or an async action sitting in the queue waiting to be processed, in which case boolean true will be returned. Or there may be no async, in-progress or pending action for this hook, in which case, boolean false will be the return value.

Хуков нет.


Число/true/false. The timestamp for the next occurrence of a pending scheduled action, true for an async or in-progress action or false if there is no matching action.


as_next_scheduled_action( $hook, $args, $group );
$hook(строка) (обязательный)

По умолчанию: NULL

По умолчанию: ''

Код as_next_scheduled_action() WC 4.6.0

function as_next_scheduled_action( $hook, $args = NULL, $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return false;
	$params = array();
	if ( is_array($args) ) {
		$params['args'] = $args;
	if ( !empty($group) ) {
		$params['group'] = $group;

	$params['status'] = ActionScheduler_Store::STATUS_RUNNING;
	$job_id = ActionScheduler::store()->find_action( $hook, $params );
	if ( ! empty( $job_id ) ) {
		return true;

	$params['status'] = ActionScheduler_Store::STATUS_PENDING;
	$job_id = ActionScheduler::store()->find_action( $hook, $params );
	if ( empty($job_id) ) {
		return false;
	$job = ActionScheduler::store()->fetch_action( $job_id );
	$scheduled_date = $job->get_schedule()->get_date();
	if ( $scheduled_date ) {
		return (int) $scheduled_date->format( 'U' );
	} elseif ( NULL === $scheduled_date ) { // pending async action with NullSchedule
		return true;
	return false;