J
J
judino2016-02-26 23:44:01
PHP
judino, 2016-02-26 23:44:01

Parse error: syntax error, unexpected What's wrong?

Friends!
I am superficially familiar with PHP (to say the least).
Before, God had mercy on problems, but here comes the black hour \order-comment-filed.php on line 16
It's clear that the trouble lies in the 16th line of the specified file's code. It
's terrible that I don't understand what's wrong
.
add_action
( 'comment_form_before', function()
{
if( class_exists( 'WPSE_Rearrange_Comment_Fields' ) )
{
$fields = apply_filters(
'wpse_comment_fields',
[ 'comment', 'author', 'url', 'email', 'submit' ] (16th line)
);
$o = new WPSE_Rearrange_Comment_fields;
$o->set_fields( $fields )
->init();
}
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel K, 2016-02-27
@PavelK

Your php version is old.
The problem is just

$fields = apply_filters( 
'wpse_comment_fields', 
[ 'comment', 'author', 'url', 'email', 'submit' ] (16-я строка)
);

namely, a shortened array notation:
replace with
array( 'comment', 'author', 'url', 'email', 'submit' )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question