It sounds as if you’re having problems adding submenus from a plugin to a parent item registered in another plugin.
Add priorities to your admin_menu
actions to make sure the parent(top level) item exists at the point your additional plugins attempt to add items to that menu..
Add top level
add_action('admin_menu', 'main_menu', 100 );
Add sub items
add_action('admin_menu', 'register_submenu', 105 );
Default priority is 10, so your two callbacks were possibly executing in the wrong order.
Let me know if that helps.
Related Posts:
- add_menu_page() with different name for first submenu item
- How to add sub-menu to a menu generated by wp_nav_menu by using plugin
- Change the_title() of a page dynamically
- How do I programatically insert a new menu item?
- Add Dividers or Separators Between Nav Menu Items
- Nav Menu meta failing to import
- Overwriting Core WordPress Functions with Plugins
- Some nav-menu filters do nothing
- Determine which theme location a wp_get_nav_menu_items is for
- Can I add pages to my custom menu via script?
- Replacing WordPress menu functionality with a plugin
- Hook event for upload image in the menu
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- How do I approach removing menu items on the fly based on settings in my plugin?
- What is the difference between current_page_parent and current_page_ancestor?
- Delete a specific item menu when I deactivate my plugin
- Create a Page via plugin
- Add Submenu Link in add_submenu_page That Opens in a New Window
- How to assign a WP 3.0 custom nav menu to a theme’s navigation menu location via script?
- Header Button Chance Polylang Elementor
- PHP 7 – Class Method Compatibility Issue
- How to add pages to custom menus on the fly [duplicate]
- Add notification bubble notice in navigation using transients
- Get Current Menu Location inside Nav_Walker
- Adding custom fields to WordPress nav menus
- Sub Menu content is being duplicated
- Plugin menu addition in multisite
- Remove unwanted elements for a wp_nav_menu
- Is this best practice for Dynamically adding items to WordPress menus?
- How to remove or add submenu item on plugin activate or deactive
- Custom code for WordPress dynamic menu
- How do I access the menus produced by Dashboard > Appearance > Menus
- wordpress add_submenu_page adds broken link
- WP Enqueue style on all plug-in pages
- Add child pages to submenu automatically
- Customize existing menu item
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- Issue with plugin sub menu and pages
- How to add Plugin functionality in WordPress Frontend Menus
- How to hide page links from theme menu
- WP_NAV_MENU filter targets all menus
- How do I add a menu item to a Pods admin menu?
- Add user managable titles to custom menus?
- How to create archive page to add in menu
- How to show only the last two categories in a menu?
- Always hide a page from the menu
- remove different admin menu for specific users
- How to get an array out of a nav menu if it’s a plugin?
- What happens when you create/edit a menu
- Plugin admin list pages as submenu
- Adding parent custom post type menu option
- Create and style menu
- Change the class of wordpress menu
- Invalid Menu Items
- Declaration of mandoe_menu_walker::start_el(&$output, $item, $depth, $args) must be compatible with Walker::start_el(…)
- Custom Nav Walker $item->url producing malformed hyperlinks
- Displaying an Uploaded Image as a Custom Avatar in WordPress
- Adding a navigation with wp_nav_menu() to a custom block in the site editor
- Objective Best Practices for Plugin Development? [closed]
- wp_mail is undefined
- Build path for a custom portfolio plugin
- How to save block attributes when the output doesn’t change
- How to: Rest endpoint returning empty object
- Ensuring a plugin is loaded/run last?
- Plugin options table,is the data serialized
- Converting theme widgets to plugins?
- Sample — test — data for large WordPress install
- DIR vs URI when defining a path to a file
- WP_LOCALIZE_SCRIPT doesn’t work
- JS / JQuery form validation in backend admin menus
- Is using register_activation_hook required?
- update post meta for checkbox in the admin when inserted in the front-end
- Gutenberg Block showing invalid content on edit
- Register a sidebar in a WordPress plugin
- Check for template part, else filter content
- Search the product by tag or category not working
- Is it possible to make sure that only my plugins output is shown to the enduser?
- Codex Version Focus on Production or Nightly?
- Make a plugin page out of influence of the theme’s style
- Fatal error: Uncaught Error: Call to undefined function convert_to_screen()
- Multiple array for post_content on plugin activation
- Using AND and bracket grouping in SQL not working
- Check if the current user is author of first comment
- How do I force a download in the admin area?
- add_action wp_ajax_ not loading in plugin file WP Network
- Configuring Xdebug with docker compose
- Get the current post/page URL with plain permalinks
- ajax multiple Values
- Change Label of custom post type
- admin-ajax.php returns “No Script Kiddies!” sometimes
- Plugin outputs content of posts unbidden!
- Client Profiles
- Update custom settings field in plugin
- URL rewrite parameter lost (add_rewrite_rule)
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- add category id to option name when adding an option on edit_category
- esc_url, esc_url_raw or sanitize_url?
- React Plugin Settings Page Localization
- Is it within WordPress guidelines to update another plugin’s database fields from my own plugin? [closed]
- Block Development: hamburger module throwing error in save function