WC_Action_Queue::get_next( string $hook, array $args = null, string $group = '' )

Get the date and time for the next scheduled occurence of an action with a given hook (an optionally that matches certain args and group), if any.


Description Description


Parameters Parameters

$hook

(Required) The hook that the job will trigger.

$args

(Optional) Filter to a hook with matching args that will be passed to the job when it runs.

Default value: null

$group

(Optional) Filter to only actions assigned to a specific group.

Default value: ''


Top ↑

Return Return

(WC_DateTime|null) The date and time for the next occurrence, or null if there is no pending, scheduled action for the given hook.


Top ↑

Source Source

File: includes/queue/class-wc-action-queue.php

	public function get_next( $hook, $args = null, $group = '' ) {

		$next_timestamp = as_next_scheduled_action( $hook, $args, $group );

		if ( $next_timestamp ) {
			return new WC_DateTime( "@{$next_timestamp}", new DateTimeZone( 'UTC' ) );
		}

		return null;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.