classes
1 year ago
deprecated
1 year ago
lib
1 year ago
action-scheduler.php
1 year ago
functions.php
1 year ago
index.php
3 years ago
action-scheduler.php
31 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) exit; |
| 3 | if ( ! function_exists( 'action_scheduler_register_3_dot_9_dot_2' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION. |
| 4 | if ( ! class_exists( 'ActionScheduler_Versions', false ) ) { |
| 5 | require_once __DIR__ . '/classes/ActionScheduler_Versions.php'; |
| 6 | add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 ); |
| 7 | } |
| 8 | add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_9_dot_2', 0, 0 ); // WRCS: DEFINED_VERSION. |
| 9 | // phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace |
| 10 | function action_scheduler_register_3_dot_9_dot_2() { // WRCS: DEFINED_VERSION. |
| 11 | $versions = ActionScheduler_Versions::instance(); |
| 12 | $versions->register( '3.9.2', 'action_scheduler_initialize_3_dot_9_dot_2' ); // WRCS: DEFINED_VERSION. |
| 13 | } |
| 14 | // phpcs:disable Generic.Functions.OpeningFunctionBraceKernighanRitchie.ContentAfterBrace |
| 15 | function action_scheduler_initialize_3_dot_9_dot_2() { // WRCS: DEFINED_VERSION. |
| 16 | // A final safety check is required even here, because historic versions of Action Scheduler |
| 17 | // followed a different pattern (in some unusual cases, we could reach this point and the |
| 18 | // ActionScheduler class is already defined—so we need to guard against that). |
| 19 | if ( ! class_exists( 'ActionScheduler', false ) ) { |
| 20 | require_once __DIR__ . '/classes/abstracts/ActionScheduler.php'; |
| 21 | ActionScheduler::init( __FILE__ ); |
| 22 | } |
| 23 | } |
| 24 | // Support usage in themes - load this version if no plugin has loaded a version yet. |
| 25 | if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler', false ) ) { |
| 26 | action_scheduler_initialize_3_dot_9_dot_2(); // WRCS: DEFINED_VERSION. |
| 27 | do_action( 'action_scheduler_pre_theme_init' ); |
| 28 | ActionScheduler_Versions::initialize_latest_version(); |
| 29 | } |
| 30 | } |
| 31 |