Improve autoloader method

This commit is contained in:
Luke Carbis 2015-10-15 23:31:52 +10:00
parent 911adc5bb9
commit 0c83dd0e32
2 changed files with 1 additions and 6 deletions

View file

@ -472,7 +472,6 @@ class MainWP_Backup {
}
public function createZipPclFullBackup2( $filepath, $excludes, $addConfig, $includeCoreFiles, $excludezip, $excludenonwp ) {
global $main_wp_class_dir;
//Create backup folder
$backupFolder = dirname( $filepath ) . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR;
// @codingStandardsIgnoreStart

View file

@ -13,12 +13,8 @@ if ( ( isset( $_REQUEST['heatmap'] ) && '1' === $_REQUEST['heatmap'] ) || ( isse
//header('X-Frame-Options: GOFORIT');
include_once( ABSPATH . 'wp-includes' . DIRECTORY_SEPARATOR . 'version.php' ); //Version information from wordpress
$main_wp_class_dir = trailingslashit( plugin_dir_path( dirname( __FILE__ ) ) ) . 'class';
function mainwp_child_autoload( $class_name ) {
global $main_wp_class_dir;
$autoload_dir = \trailingslashit( $main_wp_class_dir );
$autoload_dir = \trailingslashit( dirname( __FILE__ ) . '/class' );
$autoload_path = sprintf( '%sclass-%s.php', $autoload_dir, strtolower( str_replace( '_', '-', $class_name ) ) );
if ( file_exists( $autoload_path ) ) {