最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugins - Parse error : syntax error, unexpected ')' in

programmeradmin5浏览0评论

I'm trying to install a new theme for a wordpress site and when I want to activate a plugin I get this error. Can you help me understand how to solve this error?

function thegem_cf_shortcode_settings()
{
    return array(
        'name' => __('Custom Fields', 'thegem'),
        'base' => 'gem_custom_fields',
        'icon' => 'thegem-icon-wpb-ui-custom-fields',
        'category' => __('TheGem', 'thegem'),
        'description' => __('Custom Fields', 'thegem'),
        'params' => array_merge(
            /* General - Layout */
            thegem_cf_set_layout_params(),

            /* General - Styles */
            thegem_cf_set_style_params(),

            /* Extra Options */
            thegem_set_elements_extra_options(),

            // Design Options
            thegem_cf_set_design_options_params(),

            /* Responsive Options */
            thegem_set_elements_responsive_options(),
            thegem_cf_extends_responsive_options_params(),
         
     )      
}

function thegem_cf_shortcode($atts, $content)
{

I'm trying to install a new theme for a wordpress site and when I want to activate a plugin I get this error. Can you help me understand how to solve this error?

function thegem_cf_shortcode_settings()
{
    return array(
        'name' => __('Custom Fields', 'thegem'),
        'base' => 'gem_custom_fields',
        'icon' => 'thegem-icon-wpb-ui-custom-fields',
        'category' => __('TheGem', 'thegem'),
        'description' => __('Custom Fields', 'thegem'),
        'params' => array_merge(
            /* General - Layout */
            thegem_cf_set_layout_params(),

            /* General - Styles */
            thegem_cf_set_style_params(),

            /* Extra Options */
            thegem_set_elements_extra_options(),

            // Design Options
            thegem_cf_set_design_options_params(),

            /* Responsive Options */
            thegem_set_elements_responsive_options(),
            thegem_cf_extends_responsive_options_params(),
         
     )      
}

function thegem_cf_shortcode($atts, $content)
{
Share Improve this question edited Jul 31, 2023 at 17:03 YourManDan 4342 silver badges12 bronze badges asked Jul 30, 2023 at 21:51 Izabela Cecilia MilaIzabela Cecilia Mila 1 1
  • 2 Check the error log, the stack trace should tell you exactly which lines of which PHP file the error is. – ray-happyforms Commented Jul 31, 2023 at 6:26
Add a comment  | 

1 Answer 1

Reset to default 4

You have a missing closing bracket on your params parameter on the array_merge(). It should look like this:

    return array(
        'name' => __('Custom Fields', 'thegem'),
        'base' => 'gem_custom_fields',
        'icon' => 'thegem-icon-wpb-ui-custom-fields',
        'category' => __('TheGem', 'thegem'),
        'description' => __('Custom Fields', 'thegem'),
        'params' => array_merge(
            /* General - Layout */
            thegem_cf_set_layout_params(),

            /* General - Styles */
            thegem_cf_set_style_params(),

            /* Extra Options */
            thegem_set_elements_extra_options(),

            // Design Options
            thegem_cf_set_design_options_params(),

            /* Responsive Options */
            thegem_set_elements_responsive_options(),
            thegem_cf_extends_responsive_options_params(),
         ) // <-- missing this bracket
     ); // <-- missing semicolon
发布评论

评论列表(0)

  1. 暂无评论