Syntax Error
-
Sorry for not understanding this. I keep getting this error:
Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given
Apparently it is because $item is undefined. Below is the sample on the plugin page:
But what is $item supposed to be ????———————————–
function my_new_menu_conditions($conditions) {
$conditions[] = array(
‘id’ => ‘single-my-custom-post-type’,
‘name’ => __(‘Single my-custom-post-type’, ‘i18n-domain’),
‘condition’ => function($item) {
return is_singular(‘my-custom-post-type’);
}
);return $conditions;
}
———————————————————
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Syntax Error’ is closed to new replies.