[英]Parse error: syntax error, unexpected ';', expecting ')' (Wordpress functions.php)
I have been creating a module for visual composer plugin, however, when I already have all the code mounted and saved in the functions.php
file, I get the following error: 我一直在为可视作曲家插件创建模块,但是,当我已经安装了所有代码并将其保存在
functions.php
文件中时,出现以下错误:
syntax error, unexpected ';', expecting ')' - line 72
I have looked to see if it is that by chance some ,
;
我已经看过,看它是否是偶然一些
,
;
or )
was missing, but I do not find any missing. 或
)
丢失,但我找不到任何丢失的内容。
This is the code of function: 这是功能代码:
function create_vc_adproducttag() {
vc_map( array(
"category" => "Myshortcodes Woocommerce",
"name" => "Productos por etiquetas",
"base" => "product_tag",
"description" => "Este módulo incorpora productos pertenecientes a cualquier etiqueta",
"show_settings_on_create" => true,
"class" => "vc-adproducttag",
"icon" => "",
"params" => array(
// Campo para las etiquetas
array(
"heading" => "Etiquetas",
"type" => 'autocomplete',
"param_name" => 'tags',
"description" => "Elige las etiquetas de las que quieras que se muestren los productos",
"admin_label" => true,
'value' => '',
'settings' => array(
'multiple' => true,
'sortable' => true,
'unique_values' => true
),
'description' => ''
),
// Campo para las columnas
array(
"heading" => "Columnas",
"type" => "textfield",
"param_name" => "columns",
"description" => "Número de columnas por fila",
"value" => "5",
"admin_label" => true,
'edit_field_class' => 'vc_col-sm-6 vc_column clear'
),
// Campo para el operador
array(
"heading" => "Operador",
"type" => "dropdown",
"param_name" => "operator",
"description" => "Elige el operador que quieres",
"value" => array(
esc_html__('' ) => 'Ninguno',
esc_html__('IN') => 'Dentro de la etiqueta...',
esc_html__('NOT IN') => 'Fuera de la etiqueta...',
esc_html__('AND') => 'Dentro de las siguentes etiquetas...',
"admin_label" => true
),
// Campo para productos por pagina
array(
"heading" => "Productos por página",
"type" => "dropdown",
"param_name" => "per_page",
"description" => "Elige cuantos productos quieres que se muestren por página",
"value" => array(
esc_html__('-1' ) => 'Todos',
esc_html__('12') => '12',
esc_html__('24') => '24',
esc_html__('36') => '36',
"admin_label" => true
),
)
) );
}
add_action( 'vc_before_init', 'create_vc_adproducttag' );
Could someone tell me the cause of this error? 有人可以告诉我这个错误的原因吗?
Maybe it's just that my eyes are playing tricks on me and something important is missing in the code... 也许只是我的眼睛在欺骗我,代码中缺少一些重要的东西...
I would appreciate any help possible. 我将不胜感激。
Thank you very much. 非常感谢你。
/******** EDIT: *****/ / ********编辑:***** /
I have already found the error. 我已经发现错误。
The problem is that I'm missing 2 );
问题是我想念2
);
after array 阵列后
Your problem is before add_action call: 您的问题是在add_action调用之前:
) ))); )))); instead of ) );
代替 ) );
括号在// Campo para el operador
下方和// Campo para productos por pagina
下方打开的数组似乎错过了其右括号。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.