Return value of add_menu_page

One important use is enqueue script / style only on specific plugin/admin pages. <?php add_action(‘init’, ‘my_plugin_admin_page’); function my_plugin_admin_page() { //create the menu page $hook = add_menu_page(….); //use the hook for this page for enqueuing add_action(‘admin_print_styles-‘ . $hook, ‘my_plugin_admin_styles’); } function my_plugin_admin_styles() { //enqueue the style/script here } ?> This is one use I know.

add_submenu_page not working

Make sure that your add_action hook is set to admin_menu. Here’s a sample code: add_action(‘admin_menu’, ‘wpse149688’); function wpse149688(){ add_menu_page( ‘Wholesale Pricing’, ‘Wholesale’, ‘manage_options’, ‘woo-wholesale’, ‘woo_wholesale_page_call’); add_submenu_page( ‘woo-wholesale’, ‘Registrations’, ‘Registrations’, ‘manage_options’, ‘woo-wholesale-registrations’, ‘wwpr_page_call’ ); } Also check whether user you’ve logged in as has the ability to view this menu. As this menu is set using … Read more