Use the action admin_menu
as opposed to admin_init
. You also need to adjust your use of remove_submenu_page
to match the way Newsletter adds menu items:
remove_submenu_page( 'newsletter_main_index', 'newsletter_main_index' );
remove_submenu_page( 'newsletter_main_index', 'newsletter_main_main' );
remove_submenu_page( 'newsletter_main_index', 'newsletter_main_diagnostic' );
remove_submenu_page( 'newsletter_main_index', 'newsletter_subscription_profile' );
Related Posts:
- Custom menu walker: how can i check first item
- How to add a child item to a menu element (using wp_nav_menu_objects)
- Primary and secondary menus
- how to get custom admin submenu( custom post type ) item to highlight when its active
- Walker nav remove submenu ul from a certain depth
- WordPress bootstrap menue with 3. level
- Subnav menu – adapt to show the same on parent, child & grandchildren pages?
- disable menu collapse/expand function and make a menu item a static, unclickable text
- Submenu causes issue in defined blog page
- Define supporting only 1-level menu
- Get the page IDs of a Particular Menu item’s submenu
- sub-menu does not show on the very top bar
- How to exclude/remove submenu using Walker_Nav_Menu
- Links doesnt appear as a submenu on a mobile
- Notices are render inside sub-menu’s content
- Problem add submenu page
- Controlling the position of dropdow submenu
- Assign index page to my mobile site?
- Restrict days in bootstrap datepicker using checkboxes in submenu
- Need help finding information to create this type of page
- Trouble posting in Sub-Category
- Subpages List Appearing on Every Page
- Active class on side menu
- I need to get this sub nav to show up on cat, sup-cat and post
- Show menu on page with all sub-pages and sub-sub-pages of that page
- WordPress two row automatic sub navigation with double wp_list_pages. Is it impossible?
- Horizontal sub-menu on one line
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Remove Categories / Tags From Admin Menu
- WordPress API Menu/Submenu Order
- how to create a menu with all sub categories?
- Remove a menu item created by a plugin
- Add a .last class to the last in each ul.sub-menu
- Multi Level Bootstrap Navigation Menu in WordPress
- wp_nav_menu() loses ‘current-menu-*’ classes on single product page within category
- checkbox in post add/edit to add/remove the post from menu
- How to make pages metabox display all hierarchy in menu admin?
- Custom Nav Walker sub-menu HTML construct
- Subpages return 404 error [closed]
- Custom Walker for Walker_Nav_Menu
- Handling complex multi-level architecture / menu for large site
- How to display dynamic content in start_lvl function
- Create self-populating menu and add extra divs to the menu layout
- Menus like a CMS
- next_post_link() on custom menu structure
- How to add a submenu toggle button inside all “li” elements that have a submenu?
- Admin Panel – Custom Menu Sub-Item LINK
- Find the Children of a Page then Echo it as a Bulleted List of Links (menu)
- submenu item edit a specific post
- How to include a third level with wp_get_nav_menu_items function
- wp_nav_menu() with multiple Class
- Schedule Page to Menu [duplicate]
- How do you manage large menu hierarchies in WP?
- How can I make this custom menu work?
- Trying to Create Menu in WordPress
- Hierarchical menu nesting problem with jQuery targetting
- Add code to WordPress menu items by class
- Adding a submenu to the Tools menu returns tools.php in a popup box
- Register submenu on network menu from the subsite
- How to customize submenus isn wordpress theme [closed]
- Can I have a different menu for each parent page?
- remove class “sub-menu” from wordpress drop down menu
- Add a submenu to wp_nav_menu
- Wrap list parent in div with wp_nav_menu menu
- Access for adding subpages but not for pages
- How to remove and disable access to General Settings Page including its link
- Use current class method inside add_submenu_page()
- sub menu link is not working
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Make Home page current if there are sub-menus
- How to use wp_nav_menu to create custom dropdown menu?
- How to Add support for sub-menu item description in wordpress?
- How to hightlight all ancestor menu items of a child page NOT displayed in menu
- Add menu headings to WordPress sub menus
- Show login greeting above sub-menu links?
- Link to subpages on the same page
- Add Login and logout buttons to top menu bar
- How to access wordpress menu & submenu item through the REST API?
- cannot get global $menu value in form request
- Show Sub Menu on click and not hover
- add sub_menu to a sub_menu (multiLevel sub_menu) in admin menu in wordpress
- Bootstrap Theme Migrated to WordPress
- How to add all subcategories as submenu in WordPress menu
- Creating navigation out of specific IDs and their children?
- Show all menu levels except top level. How to exclude top level of a menu?
- Admin – Custom Post Type in WooCommerce menu – how to control menu order
- Add subemenu option page
- Product categories are mixed when creating menu
- WordPress menu walker – Get parent item text inside end_lvl function
- how to create pages and link them to a menu
- How to separate sub-menu output and keep associated with parent
- Problem with sub-menu container
- How I can add div to menu?
- Show Child of Parent Page including all other parents
- Ajax Not Working If The Handler is Located Outside Plugin Submenu Page Function
- How do I get my nav menu to show sub pages?
- Adding Sub Menu In a theme which Do not have Menu Options
- How can I alter the visible menu according to which level I am on [closed]
- Add wrapper for a specific sub-menu
- Add acf custom fields so sub item in menus