Snippet doesn’t accept multi-line comment like /* … */
-
Hello,
I was testing and debugging a snippet for generateblocks query loop. And when I put one part of the code in comment like below, site crashed.
/* comment
comment
comment
comment */Error log
PHP Parse error: Unmatched '}' in /.../wp-content/wpmastertoolkit/code-snippets/include-1755.php on line 5Tested snippet
add_filter( 'generateblocks_query_loop_args', 'snip3w_gb_query_orderby_members', 10, 2 );
function snip3w_gb_query_orderby_members( $query_args, $attributes ) {
if ( ! is_admin() &&
! empty( $attributes['className'] )
&& strpos( $attributes['className'], 'query-orderby-members' ) !== false
) {
$query_args['orderby'] = 'title';
$query_args['order'] = 'DESC';
/*$query_args = array_merge(
$query_args, array(
'orderby' => array(
'menu_order' => 'ASC',
'title' => 'ASC',
)
)
);*/
}
return $query_args;
}
You must be logged in to reply to this topic.