Question: Wordpress Issue Create Menu Option

Question

Wordpress Issue Create Menu Option

Answers 2
Added at 2016-12-29 04:12
Tags
Question

I have created a Custom Setting API for web developing for a client. I was just creating first menu option on the WP dashboard.

But when I send file I get this error message saying --> :call_user_func_array() expects parameter 1 to be a valid callback, function ' allb_admin_page' not found or invalid function name in

function allb_admin_page() {

  add_menu_page( ' ALLB Theme Options', 'ALLB', 'manage_options', 'a-legacy-left-behind', 'allb_theme_create_page', 110);

}

add_action( 'admin_menu', ' allb_admin_page' );

function allb_theme_create_page() {
  // genration of our admin page
}

I was thinking this may be new update or this function that i am using might be removed from WordPress or i am doing something wrong please explain.

Can anyone help with this quick issue having on word press, please?

Thank you, Happy New Years!!!

Answers to

Wordpress Issue Create Menu Option

nr: #1 dodano: 2016-12-29 08:12

Here is the answer..

Please try it once, Just copy and past this code..

function allb_admin_page() {
  add_menu_page('ALLB Theme Options', 'ALLB', 'manage_options', 'a-legacy-left-behind', 'allb_theme_create_page', 110);

}
add_action('admin_menu','allb_admin_page');

function allb_theme_create_page() {
  // genration of our admin page
}

I hope it'll help to you..

nr: #2 dodano: 2016-12-29 08:12

You need to remove the space:

add_action('admin_menu', 'allb_admin_page');
Source Show
◀ Wstecz