Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW)
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW)
嘿,我正在尝试在 wordpress 主题中添加自定义选项,允许用户在展示柜中上传自己的图片,但我的 customize.php 文件中出现语法错误。任何人都可以帮助我以正确的方式写这个吗?谢谢!
解析错误:第 13 行 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/themes/wpbootstrap/inc/customizer.php 中的语法错误,意外的“=>”(T_DOUBLE_ARROW)
$wp_customize->add_setting('showcase_image', array(
'default' => get_bloginfo('template_directory').'/img/showcase.jpg', 'wpbootstrap'),
line 13 'type' => 'theme_mod'
));
没有用勺子喂答案(按照上面@community 的要求),而是提供了一种可重复使用的技术来查找这些类型的错误...
暂时重新格式化您的代码,使所有函数参数 and/or 数组元素都在它们自己的行上并适当地使用标识。最终你可能会看到一些不是你想要的东西。下面的例子(你快到了)。
$wp_customize->add_setting(
'showcase_image', // func parm
array(
'default' => get_bloginfo(
'template_directory'
).'/img/showcase.jpg',
'wpbootstrap'
),
'type' => 'theme_mod'
)
);
嘿,我正在尝试在 wordpress 主题中添加自定义选项,允许用户在展示柜中上传自己的图片,但我的 customize.php 文件中出现语法错误。任何人都可以帮助我以正确的方式写这个吗?谢谢!
解析错误:第 13 行 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/themes/wpbootstrap/inc/customizer.php 中的语法错误,意外的“=>”(T_DOUBLE_ARROW)
$wp_customize->add_setting('showcase_image', array(
'default' => get_bloginfo('template_directory').'/img/showcase.jpg', 'wpbootstrap'),
line 13 'type' => 'theme_mod'
));
没有用勺子喂答案(按照上面@community 的要求),而是提供了一种可重复使用的技术来查找这些类型的错误...
暂时重新格式化您的代码,使所有函数参数 and/or 数组元素都在它们自己的行上并适当地使用标识。最终你可能会看到一些不是你想要的东西。下面的例子(你快到了)。
$wp_customize->add_setting(
'showcase_image', // func parm
array(
'default' => get_bloginfo(
'template_directory'
).'/img/showcase.jpg',
'wpbootstrap'
),
'type' => 'theme_mod'
)
);