PHP 错误提示求救 10
网站程序上传后提示Parseerror:syntaxerror,unexpectedT_FUNCTIONin/data/home/qxu1539850170/htdocs...
网站程序上传后 提示
Parse error: syntax error, unexpected T_FUNCTION in /data/home/qxu1539850170/htdocs/wx/wp-content/themes/blt-katla/inc/acf/acf-init.php on line 48
错误
但是找了很久也没有发现问题所在。麻烦大神帮忙看一下。万谢
一下是php错误页面提示内容
?php
require_once 'add-ons/acf-google-font-selector-field/acf-google_font_selector.php';
// 1. customize ACF path
add_filter('acf/settings/path', 'my_acf_settings_path');
function my_acf_settings_path( $path ) {
$path = get_template_directory() . '/inc/acf/';
return $path;
}
// 2. customize ACF dir
add_filter('acf/settings/dir', 'my_acf_settings_dir');
function my_acf_settings_dir( $dir ) {
$dir = get_template_directory_uri() . '/inc/acf/';
return $dir;
}
// 3. Hide ACF field group menu item
add_filter('acf/settings/show_admin', '__return_'.(defined('BLT_DEBUG') ? 'true' : 'false'));
// 4. Include ACF
include_once( get_template_directory() . '/inc/acf/acf.php' );
// Create options pages
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Theme Settings',
'menu_title' => BLT_THEME_NAME. ' Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_theme_options',
'redirect' => false
));
acf_add_options_sub_page(array(
'page_title' => 'Purchase Key',
'capability' => 'edit_theme_options',
'menu_title' => 'Purchase Key',
'parent_slug' => 'theme-general-settings',
));
}
add_filter('acf/settings/load_json', function($paths) {
$paths = array(get_template_directory() . '/acf-json');
if(is_child_theme())
{
$paths[] = get_stylesheet_directory() . '/acf-json';
}
return $paths;
}); 展开
Parse error: syntax error, unexpected T_FUNCTION in /data/home/qxu1539850170/htdocs/wx/wp-content/themes/blt-katla/inc/acf/acf-init.php on line 48
错误
但是找了很久也没有发现问题所在。麻烦大神帮忙看一下。万谢
一下是php错误页面提示内容
?php
require_once 'add-ons/acf-google-font-selector-field/acf-google_font_selector.php';
// 1. customize ACF path
add_filter('acf/settings/path', 'my_acf_settings_path');
function my_acf_settings_path( $path ) {
$path = get_template_directory() . '/inc/acf/';
return $path;
}
// 2. customize ACF dir
add_filter('acf/settings/dir', 'my_acf_settings_dir');
function my_acf_settings_dir( $dir ) {
$dir = get_template_directory_uri() . '/inc/acf/';
return $dir;
}
// 3. Hide ACF field group menu item
add_filter('acf/settings/show_admin', '__return_'.(defined('BLT_DEBUG') ? 'true' : 'false'));
// 4. Include ACF
include_once( get_template_directory() . '/inc/acf/acf.php' );
// Create options pages
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Theme Settings',
'menu_title' => BLT_THEME_NAME. ' Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_theme_options',
'redirect' => false
));
acf_add_options_sub_page(array(
'page_title' => 'Purchase Key',
'capability' => 'edit_theme_options',
'menu_title' => 'Purchase Key',
'parent_slug' => 'theme-general-settings',
));
}
add_filter('acf/settings/load_json', function($paths) {
$paths = array(get_template_directory() . '/acf-json');
if(is_child_theme())
{
$paths[] = get_stylesheet_directory() . '/acf-json';
}
return $paths;
}); 展开
1个回答
展开全部
acf_add_options_sub_page(array(
'page_title' => 'Purchase Key',
'capability' => 'edit_theme_options',
'menu_title' => 'Purchase Key',
'parent_slug' => 'theme-general-settings', //这里多了个逗号吧
));
'page_title' => 'Purchase Key',
'capability' => 'edit_theme_options',
'menu_title' => 'Purchase Key',
'parent_slug' => 'theme-general-settings', //这里多了个逗号吧
));
更多追问追答
追问
修改后,依旧是同样的错误提示。下面
add_filter('acf/settings/load_json', function($paths) {
没有错误么?
追答
acf-init.php的48行是啥
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询