If available the $GLOBALS[ 'menu' ] array holds data for each top level menu item in the dashboard, and in the sub array for the Woocommerce “Marketing” menu item, key 2 has the value you’re looking for: "woocommerce-marketing".
So with that your add_submenu_page should look like the below to make your sub menu item show up under the Woocommerce Marketing menu item:
add_submenu_page(
'woocommerce-marketing',
__( 'Sub Menu' ),
'manage_woocommerce',
'sub-menu-slug',
'sub_menu_page_callback'
);
Related Posts:
- How to call a plugin function from index.php
- Rewriting every url
- Passing URL parameters to WordPress pages and pretty url
- Publish Post After Click On A Link
- How to get the custom page get_permalink?
- Custom url structure for custom template
- Add a Custom Permalink option in the Permalink Admin Screen?
- How to get the permalink of a page when loading my plugin
- How to change custom post type pemalink Hierarcy
- Modifying Author Link to add Author Meta in URL
- Perform internal redirect in WordPress?
- How to get the permanent link in a plugin?
- flush_rewrite_rules() not working with update_option_{$option}
- Add_rewrite_endpoint doesn’t work with post name permalink structure
- How to embed a new string in url?
- Make get_permalink() work outside the Loop using filters
- help intercepting save_post through plugin
- WordPress Frontend Page using Plugin
- Child theme modifications not showing up
- Create new page in wordpress plugin which doesn’t exist
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- Changing author slug for a custom role without using plugin
- Custom author page for custom role
- Custom role not listed
- Is it possible to change plugin’s Admin Panel Url?
- Coming soon pages with rest of site in maintenance mode
- claim a permalink and all sublinks in plugin
- Best way to initiate a class in a WP plugin?
- What Plugins Demonstrate Great WP Plugin Development? [closed]
- Why activate_plugin is not working in register_activation_hook
- Best Practice for Referencing the Plugin Directory
- Query Posts by Custom Field ‘Price’
- fatal error get_page_permastruct()
- WP WC CLI – WooCommerce setup store with wp-cli [closed]
- How to pass JavaScript variable to PHP in wordpress widget?
- Unable to add admin notice on plugin activation
- Shortcode display outside the div
- Pass $this to function nested in another public function of the same class
- Unable to load stylesheets and scripts to plugin settings page
- Correct way to use register_activation_hook
- Licensing of freemium plugin
- Way to hook into a sidebar call to replace it with a custom sidebar
- How to trigger an action with a URL
- Default Plugin Settings Not Writing to Database
- WP Plugin Developers – Accessing my wordpress site [closed]
- How to ‘clone’ a wp plugin to make small changes
- MITM risk of not sanitizing?
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- Change plugin main file name (that is currently in the repo)
- resetting permalinks after changing page names
- Edit Yoast SEO breadcrumbs output [closed]
- Enqueue WordPress plugin scripts below all other JS
- Is there any kind of theme on WordPress to sell my own movies?
- Redirecting thousands of posts that currently have no category in their permalink when changing permalink structure to include category
- Suggestions on Approach to New Plugin I’m Stuck On
- How to redirect users to their profile after they successfully edit their profile
- Can I create a table on my DB without creating a plugin?
- WordPress checkbox and Illegal string offset
- Is it fair to use MIT licensed code in WordPress plugins? [closed]
- How to add an element right after the article using jQuery?
- How to reset wordpress but not plugins and settings
- add_submenu_page returns null
- get_option / wp_localize_script Not Working in OOP Plug In
- Switch from wp-cron to a server cron job
- How to Show Author image and url in WordPress plugin directory? [closed]
- Remember the Meta Value With Radio Buttons
- jQuery code didn’t run on my plugin
- Custom characters of tinymce editor are saved as question mark
- Custom Module, Extending WP with a Plugin?
- How do I profit from a Plugin?
- Themes conflicts and overrides my WordPress Support widget Plugin styles
- Disable Author Archive just for certain roles in bulk
- wc_get_template_part doesnt display the content [duplicate]
- How to properly use wp_mail() in my own plugin?
- I created a plugin with ‘view page’ that uses MYSQL + PHP. When I use wp_insert_post(), it turns everything to HTML
- list of custom post by custom field in frontend
- How to implement color picker from WordPress in my boilerplate plugin?
- custom post type plugin error [closed]
- How to properly enqueue jQuery knob on WordPress without conflict?
- Admin menu hilighting wrong item for CPT
- ajax voting for custom post type
- Delete postmeta when uninstall/delete plugin
- how can i get records from wp_postmeta table using particular meta_key in database?
- Inactive Plugin Files
- Saving an array to get_options
- show Visual form builder in the front end
- Plugin – including external javascript calling google maps
- Help me with my first very basic plugin
- HTML link within my plugin settings page
- How to create post comparison in wordpress
- How can I create a navigation menu in the sidebar that can also act like a slider?
- How to create a sharing marketplace with wordpress for bicycles?
- Custom wordpress plugin does not save select element
- How to set meta-data for my plugin
- WordPress isn’t sending welcome email with the password reset
- move setting data from wordpress api to codestar freamwork
- How to access the page without registering in wordpress
- CPT template is not being automatically used single post pages
- How to create new title and its description inside a section in WP Customizer?
- Custom Elementor controls not appearing in the widget Advanced tab using injection hooks