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:
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 );
after array
The arrays whose parenthesis are opened right below // Campo para el operador
and below // Campo para productos por pagina
seem to miss their closing parenthesis...