WordPress at Your Fingertips
function is not described

as_has_scheduled_action() WC .

It's recommended to use this function when you need to know whether a specific action is currently scheduled (pending or in-progress).

No Hooks.

Return

true|false. True if a matching action is pending or in-progress, false otherwise.

Usage

as_has_scheduled_action( $hook, $args, $group );
$hook(string) (required)
The hook of the action.
$args(array)
Args that have been passed to the action. Null will matches any args.
Default: null
$group(string)
The group the job is assigned to.
Default: ''

Changelog

Since . Introduced.
Since x.x.x

Code of as_has_scheduled_action() WC 6.1.1

function as_has_scheduled_action( $hook, $args = null, $group = '' ) {
	if ( ! ActionScheduler::is_initialized( __FUNCTION__ ) ) {
		return false;
	}

	$query_args = array(
		'hook'     => $hook,
		'status'   => array( ActionScheduler_Store::STATUS_RUNNING, ActionScheduler_Store::STATUS_PENDING ),
		'group'    => $group,
		'orderby'  => 'none',
	);

	if ( null !== $args ) {
		$query_args['args'] = $args;
	}

	$action_id = ActionScheduler::store()->query_action( $query_args );

	return $action_id !== null;
}