classes
1 year ago
deprecated
3 years ago
lib
3 years ago
README.md
3 years ago
action-scheduler.php
1 year ago
changelog.txt
1 year ago
functions.php
1 year ago
license.txt
3 years ago
readme.txt
1 year ago
action-scheduler.php
69 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Action Scheduler |
| 4 | * Plugin URI: https://actionscheduler.org |
| 5 | * Description: A robust scheduling library for use in WordPress plugins. |
| 6 | * Author: Automattic |
| 7 | * Author URI: https://automattic.com/ |
| 8 | * Version: 3.7.0 |
| 9 | * License: GPLv3 |
| 10 | * Tested up to: 6.4 |
| 11 | * Requires at least: 5.2 |
| 12 | * Requires PHP: 5.6 |
| 13 | * |
| 14 | * Copyright 2019 Automattic, Inc. (https://automattic.com/contact/) |
| 15 | * |
| 16 | * This program is free software: you can redistribute it and/or modify |
| 17 | * it under the terms of the GNU General Public License as published by |
| 18 | * the Free Software Foundation, either version 3 of the License, or |
| 19 | * (at your option) any later version. |
| 20 | * |
| 21 | * This program is distributed in the hope that it will be useful, |
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | * GNU General Public License for more details. |
| 25 | * |
| 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 28 | * |
| 29 | * @package ActionScheduler |
| 30 | */ |
| 31 | |
| 32 | if ( ! function_exists( 'action_scheduler_register_3_dot_7_dot_0' ) && function_exists( 'add_action' ) ) { // WRCS: DEFINED_VERSION. |
| 33 | |
| 34 | if ( ! class_exists( 'ActionScheduler_Versions', false ) ) { |
| 35 | require_once __DIR__ . '/classes/ActionScheduler_Versions.php'; |
| 36 | add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 ); |
| 37 | } |
| 38 | |
| 39 | add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_7_dot_0', 0, 0 ); // WRCS: DEFINED_VERSION. |
| 40 | |
| 41 | /** |
| 42 | * Registers this version of Action Scheduler. |
| 43 | */ |
| 44 | function action_scheduler_register_3_dot_7_dot_0() { // WRCS: DEFINED_VERSION. |
| 45 | $versions = ActionScheduler_Versions::instance(); |
| 46 | $versions->register( '3.7.0', 'action_scheduler_initialize_3_dot_7_dot_0' ); // WRCS: DEFINED_VERSION. |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Initializes this version of Action Scheduler. |
| 51 | */ |
| 52 | function action_scheduler_initialize_3_dot_7_dot_0() { // WRCS: DEFINED_VERSION. |
| 53 | // A final safety check is required even here, because historic versions of Action Scheduler |
| 54 | // followed a different pattern (in some unusual cases, we could reach this point and the |
| 55 | // ActionScheduler class is already defined—so we need to guard against that). |
| 56 | if ( ! class_exists( 'ActionScheduler', false ) ) { |
| 57 | require_once __DIR__ . '/classes/abstracts/ActionScheduler.php'; |
| 58 | ActionScheduler::init( __FILE__ ); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // Support usage in themes - load this version if no plugin has loaded a version yet. |
| 63 | if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler', false ) ) { |
| 64 | action_scheduler_initialize_3_dot_7_dot_0(); // WRCS: DEFINED_VERSION. |
| 65 | do_action( 'action_scheduler_pre_theme_init' ); |
| 66 | ActionScheduler_Versions::initialize_latest_version(); |
| 67 | } |
| 68 | } |
| 69 |