mirror of
https://github.com/mainwp/mainwp-child.git
synced 2025-09-01 03:58:07 +08:00
Improve autoloader method
This commit is contained in:
parent
911adc5bb9
commit
0c83dd0e32
2 changed files with 1 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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 ) ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue