Admin Panel – Custom Menu Sub-Item LINK

Insert the URL of the page as the $menu_slug argument. Also note that user levels are deprecated, you should pass a capability instead. function add_custom_link() { add_submenu_page( ‘edit.php?post_type=cpt_custom’, ”, ‘Pending Posts’, ‘edit_posts’, ‘edit.php?post_type=cpt_custom&post_status=pending’, ” ); } add_action(‘admin_menu’, ‘add_custom_link’);

add_sub_menu page() to be replaced by add_theme_page()

Themes are required to use add_theme_page() in the WordPress Theme Directory. You need: add_theme_page( $this->strings[‘page_title’], // Page title $this->strings[‘menu_title’], // Menu title ‘edit_theme_options’, // Capability $this->menu, // Menu slug array( &$this, ‘install_plugins_page’ ) // Callback ); s add_theme_page(theme_name.’ Settings’, theme_name ,’install_themes’, ‘panel’ , ‘panel_options’); $theme_page = add_theme_page(‘Settings’, theme_name.’ Settings’,’install_themes’, ‘panel’ , ‘panel_options’); add_theme_page(theme_name.’ Documentation’, ‘Documentation’,’install_themes’, … Read more

How to avoid creating first submenu page that is same as menu page?

You can set slug of a subpage to be the same as slug of parent page. For example: public function onixion_admin_menu_option() { add_menu_page(‘onixion’, ‘Onixion’, ‘manage_options’, ‘onixion-admin-menu’, array(&$this, ‘onixion_main_page’ ), ‘dashicons-chart-area’, ‘200’ ); add_submenu_page( ‘onixion-admin-menu’, ‘scripts’, ‘Scripts’, ‘manage_options’, ‘onixion-admin-menu’, // <– here we set the same slug as for parent page array(&$this, ‘onixion_scripts_page’ ) ); add_submenu_page( … Read more