$args Exact args the action was enqueued with. */ public static function has_pending_action( string $hook, array $args, string $group ): bool { if ( class_exists( '\ActionScheduler' ) && method_exists( '\ActionScheduler', 'store' ) ) { try { $store = \ActionScheduler::store(); if ( method_exists( $store, 'query_action' ) && defined( '\ActionScheduler_Store::STATUS_PENDING' ) ) { $action_id = $store->query_action( array( 'hook' => $hook, 'args' => $args, 'group' => $group, 'status' => array( \ActionScheduler_Store::STATUS_PENDING ), 'claimed' => false, 'orderby' => 'none', ) ); return null !== $action_id; } } catch ( \Throwable $e ) { // Store query not supported; fall back to the wrapper. } } return function_exists( 'as_has_scheduled_action' ) && as_has_scheduled_action( $hook, $args, $group ); } }