Açıklama Yok

action-scheduler.php 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.2.1
  9. * License: GPLv3
  10. *
  11. * Copyright 2019 Automattic, Inc. (https://automattic.com/contact/)
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation, either version 3 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  25. *
  26. */
  27. if ( ! function_exists( 'action_scheduler_register_3_dot_2_dot_1' ) ) {
  28. if ( ! class_exists( 'ActionScheduler_Versions' ) ) {
  29. require_once( 'classes/ActionScheduler_Versions.php' );
  30. add_action( 'plugins_loaded', array( 'ActionScheduler_Versions', 'initialize_latest_version' ), 1, 0 );
  31. }
  32. add_action( 'plugins_loaded', 'action_scheduler_register_3_dot_2_dot_1', 0, 0 );
  33. function action_scheduler_register_3_dot_2_dot_1() {
  34. $versions = ActionScheduler_Versions::instance();
  35. $versions->register( '3.2.1', 'action_scheduler_initialize_3_dot_2_dot_1' );
  36. }
  37. function action_scheduler_initialize_3_dot_2_dot_1() {
  38. // A final safety check is required even here, because historic versions of Action Scheduler
  39. // followed a different pattern (in some unusual cases, we could reach this point and the
  40. // ActionScheduler class is already defined—so we need to guard against that).
  41. if ( ! class_exists( 'ActionScheduler' ) ) {
  42. require_once( 'classes/abstracts/ActionScheduler.php' );
  43. ActionScheduler::init( __FILE__ );
  44. }
  45. }
  46. // Support usage in themes - load this version if no plugin has loaded a version yet.
  47. if ( did_action( 'plugins_loaded' ) && ! doing_action( 'plugins_loaded' ) && ! class_exists( 'ActionScheduler' ) ) {
  48. action_scheduler_initialize_3_dot_2_dot_1();
  49. do_action( 'action_scheduler_pre_theme_init' );
  50. ActionScheduler_Versions::initialize_latest_version();
  51. }
  52. }