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
- WordPress plugin from own server
- How to avoid plugin name conflicts from the upgrade notifier?
- Show Similar Post Titles ( Similar to Stack Exchange )
- Is their any way to Extend WPDB class and Overwrite the Default Query Function
- Add content to /wp-admin/plugin-install.php admin screens
- How do I only load a plugin js on it’s settings pages?
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- Activate Plugin which is in subfolder?
- Use functionality of 2 wordpress plugins
- Autoload via composer in plugin interference
- Can WordPress plugins “Talk to each other”?
- How do I store information in a dynamic block in WordPress?
- How to create custom embed block in gutenberg wordpress
- Plugin exceeds memory limit
- Find the URL of the current plugin directory
- How can sanitize $_FILES[‘haq_slider’] field
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- My plugin wants to update another plugin
- Help With MySQL to WPDB Query Conversion
- code is working properly in Core PHP but writing coding in WordPress
- Using SVN to upload plugin created with gutenberg blocks
- Force quit running background job
- Custom plugin init action causing general slowness
- Filtering get_permalink in Jetpack / ShareDaddy
- Check if plugin exists/active “class_exists()” does not work on plugin territory
- Duplicate results are displayed in a custom plugin [closed]
- Disable Individual Plugins (specifically in Custom Post Types) on a per-post basis?
- Widget’s container?
- custom uploader in the admin area
- Best/Correct way to add an option to a category
- I receive taxonomy id
- Loop in elementor custom widget not working
- Error with get_price (and others) in self-written plugin to show price
- How to access OOP plugin function inside themes or other plugin
- WordPress Widget Not Saving Instance
- Issue with wp_handle_upload
- Different registration form for different roles
- Custom Fields for Page Edits
- My plugin does not install correctly if a previous version is still installed
- How do I remove all traces of a plugin?
- Is it possible/advisable to set last stable version to previous version?
- How to solve conflict with scripts?
- wp_insert_post not inserting post from XML
- How can replace this url
- Access “wp site health info” data from plugin
- How to overwrite a plugin?
- How can I translate something in my class constructor of my plugin in WordPress?
- SimpleXML is not working with xml response from external api
- Custom Plugin Update
- Custom wp_list_tables redirect on specfic page
- Hook to display element as product on category page
- Missing files in enqueue actions causes WordPress to reload
- I can’t use WP_Query
- Adding/ Removing actions for plugins
- Get input form data posted by users
- WP Plugin: Print javascript in header
- wp_verify_nonce fails always
- Custom Plugin: Point to `template_directory`
- Adding list of Indexes in wordpress document
- API Functions to Register and Show WordPress List Tables
- Plugin options not appearing on options page using tabbed navigation
- Add custom fields in the new and edit the site forms without touching the WP core
- Extend WordPress REST API with Scheme Pro Plugin
- How to submit the custom form data in database in WordPress without plugin?
- map urls to plugins
- Embed php code in custom field of a plugin [closed]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How to update changes to multiple sites at the same time
- Why am I getting an error when requiring a file in my plugin?
- Running a function using Crown WordPress on one day a week, for example, Mondays of every week
- How to make a Template page to show the information of different things Shop and Product page?