Php 无法将自定义wordpress模块迁移到新服务器

Php 无法将自定义wordpress模块迁移到新服务器,php,wordpress,Php,Wordpress,我需要将WordPress站点迁移到实时服务器。我已经做了很多次了,除了为我不得不使用的主题(Divi)定制的模块不起作用之外,一切都很顺利。我正在使用guide加载自定义模块。例如,我在本地开发服务器上得到的是: 迁移后,我在live server上得到的是: 我能想到的唯一区别是,live服务器使用的是PHP7,而我的本地服务器使用的是PHP5。这可能是问题所在吗?以下是我在子主题的functions.php中使用的代码: /*==============================

我需要将WordPress站点迁移到实时服务器。我已经做了很多次了,除了为我不得不使用的主题(Divi)定制的模块不起作用之外,一切都很顺利。我正在使用guide加载自定义模块。例如,我在本地开发服务器上得到的是:

迁移后,我在live server上得到的是:

我能想到的唯一区别是,live服务器使用的是PHP7,而我的本地服务器使用的是PHP5。这可能是问题所在吗?以下是我在子主题的functions.php中使用的代码:

/*================================================
# LOAD CUSTOM MODULES
================================================*/
function Custom_Modules(){
 if(class_exists("ET_Builder_Module")){
 include("/custom-modules/custom-latest-case-studies.php");
 include("/custom-modules/custom-latest-resources.php");
 include("/custom-modules/custom-resources-page.php");
 include("/custom-modules/custom-blog-page.php");
 include("/custom-modules/custom-portfolio-big.php");
 include("/custom-modules/custom-portfolio-small-1.php");
 include("/custom-modules/custom-portfolio-small-2.php");
 }
}

function Prep_Custom_Modules(){
 global $pagenow;

$is_admin = is_admin();
 $action_hook = $is_admin ? 'wp_loaded' : 'wp';
 $required_admin_pages = array( 'edit.php', 'post.php', 'post-new.php', 'admin.php', 'customize.php', 'edit-tags.php', 'admin-ajax.php', 'export.php' ); // list of admin pages where we need to load builder files
 $specific_filter_pages = array( 'edit.php', 'admin.php', 'edit-tags.php' );
 $is_edit_library_page = 'edit.php' === $pagenow && isset( $_GET['post_type'] ) && 'et_pb_layout' === $_GET['post_type'];
 $is_role_editor_page = 'admin.php' === $pagenow && isset( $_GET['page'] ) && 'et_divi_role_editor' === $_GET['page'];
 $is_import_page = 'admin.php' === $pagenow && isset( $_GET['import'] ) && 'wordpress' === $_GET['import']; 
 $is_edit_layout_category_page = 'edit-tags.php' === $pagenow && isset( $_GET['taxonomy'] ) && 'layout_category' === $_GET['taxonomy'];

if ( ! $is_admin || ( $is_admin && in_array( $pagenow, $required_admin_pages ) && ( ! in_array( $pagenow, $specific_filter_pages ) || $is_edit_library_page || $is_role_editor_page || $is_edit_layout_category_page || $is_import_page ) ) ) {
 add_action($action_hook, 'Custom_Modules', 9789);
 }
}
Prep_Custom_Modules();

问题在导入行的括号中。PHP7不喜欢它们:

/*================================================
# LOAD CUSTOM MODULES
================================================*/
function Custom_Modules(){
 if(class_exists("ET_Builder_Module")){
 include "custom-modules/custom-latest-case-studies.php";
 include "custom-modules/custom-latest-resources.php";
 include "custom-modules/custom-resources-page.php";
 include "custom-modules/custom-blog-page.php";
 include "custom-modules/custom-portfolio-big.php";
 include "custom-modules/custom-portfolio-small-1.php";
 include "custom-modules/custom-portfolio-small-2.php";
 }
}