This commit is contained in:
Prospress Inc
2018-12-12 14:48:11 +01:00
committed by Remco Tolsma
parent 37367ac369
commit 721dda6e5c
340 changed files with 5114 additions and 2125 deletions

View File

@@ -59,7 +59,9 @@ abstract class ActionScheduler {
public static function autoload( $class ) {
$d = DIRECTORY_SEPARATOR;
if ( strpos( $class, 'ActionScheduler' ) === 0 ) {
if ( 'Deprecated' === substr( $class, -10 ) ) {
$dir = self::plugin_path('deprecated'.$d);
} elseif ( strpos( $class, 'ActionScheduler' ) === 0 ) {
$dir = self::plugin_path('classes'.$d);
} elseif ( strpos( $class, 'CronExpression' ) === 0 ) {
$dir = self::plugin_path('lib'.$d.'cron-expression'.$d);
@@ -67,8 +69,8 @@ abstract class ActionScheduler {
return;
}
if ( file_exists( $dir.$class.'.php' ) ) {
include( $dir.$class.'.php' );
if ( file_exists( "{$dir}{$class}.php" ) ) {
include( "{$dir}{$class}.php" );
return;
}
}
@@ -97,6 +99,10 @@ abstract class ActionScheduler {
require_once( self::plugin_path('functions.php') );
if ( apply_filters( 'action_scheduler_load_deprecated_functions', true ) ) {
require_once( self::plugin_path('deprecated/functions.php') );
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {
WP_CLI::add_command( 'action-scheduler', 'ActionScheduler_WPCLI_Scheduler_command' );
}