This commit is contained in:
Javier Casares 2026-08-24 12:10:32 +00:00
commit a558ac478c

View file

@ -14,9 +14,10 @@ if ( ! defined( 'ABSPATH' ) ) {
/**
* Thin wrapper around Action Scheduler that namespaces all jobs under a single group.
*
* Action Scheduler is declared as a required plugin (Requires Plugins: action-scheduler)
* so its functions are always available at runtime. The is_available() guard is kept
* for defensive unit-test scenarios only.
* Action Scheduler is bundled via Composer (woocommerce/action-scheduler) and
* loaded from the main plugin file, so its functions are always available at
* runtime. The is_available() guard is kept for defensive unit-test scenarios
* only.
*/
class Scheduler {
@ -31,7 +32,9 @@ class Scheduler {
* @return bool
*/
public static function is_available(): bool {
return function_exists( 'as_schedule_single_action' );
return function_exists( 'as_schedule_single_action' )
&& function_exists( 'as_has_scheduled_action' )
&& function_exists( 'as_unschedule_all_actions' );
}
/**