WordPress Plugin Customize menu and submenu -


i made pretty menu , sub menu in word press when click on menu (jobify) says url not found . sub menus working fine .

 <?php 

//adding custom admin menu add_action("admin_menu", "addmenu");

// function of custom admin menu function addmenu() { add_menu_page("jobify menu", "jobify", "manage_options", "jobifyadminmenu",'', null, 3); add_submenu_page('jobify.php', 'user', 'user', 'manage_options', 'usersubmenu','user_manage'); add_submenu_page('jobify.php', 'jobs', 'jobs', 'manage_options', 'jobssubmenu','jobs_mangae'); add_submenu_page('jobify.php', 'setting', 'setting', 'manage_options', 'settingsubmenu','setting_manage'); }

function user_manage() {

include plugin_dir_path( __file__ ) . 'user.php'; 

}
?>

you forget menu slug hence getting error .

add_menu_page("jobify menu", "jobify", "manage_options",$menu_slug, "jobifyadminmenu", null, 3);  

for example :

add_action( 'admin_menu', 'register_my_custom_menu_page' );  function register_my_custom_menu_page() {      add_menu_page( 'custom menu title', 'custom menu', 'manage_options', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );  } 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -