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
Post a Comment