Short answer, use:
$args = array('show_in_menu' => 'woocommerce');
register_post_type('my_posttype', $args);
But this won’t give you the custom post type submenus.
You can also use add_submenu_page, the code below is just an example:
function register_my_custom_submenu_page() {
add_submenu_page( 'woocommerce', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' );
}
function my_custom_submenu_page_callback() {
echo '<h3>My Custom Submenu Page</h3>';
}
add_action('admin_menu', 'register_my_custom_submenu_page',99);
You need a high(er) priority number to execute it later then the woocommerce_admin_menu function, which has 9, and there is woocommerce_admin_menu_after, which has 50 – those functionbs are in woocommerce-admin-init.php.
Related Posts:
- Turn Off Auto Update for Single Plugin
- Is there a way to use latex \cite{reference} in wordpress?
- Why is “plugins_loaded” not called/fired?
- Searching users with WP_List_Table plugin
- What is the purpose of adding a .po file?
- Security error WP 4.0 + WP phpBB Bridge [closed]
- Issues creating a tinyMCE plugin that creates a custom link
- Execute a function using ajax
- What does do_action() function do in wordpress? [duplicate]
- “Are you sure you want to do this?” when deactivating all plugins in WordPress 4.3.1 [closed]
- how to redirect to my template
- Template for custom post type shows all posts instead of just one
- Difference between register_block_type & wp.blocks.registerBlockType
- Can’t create term for product attribute
- Hidden Custom Post Type
- Adding Attachment Display Settings in custom media frame
- Conditionally bypass plugin
- How to include code into functions.php file via a plugin
- Is it possible to install two mail plugins together in a single WordPress site? How to do it? [closed]
- Theme or Plugin: Where should I write my code?
- Is it possible to use WordPress as an online portfolio for text content? What kind of theme would I look for?
- change captcha design in Fast Secure Contact Form plugin
- Correct way to make meta box with more than one meta field secure
- I want to extend the current themes’ single.php to display the meta fields of my CPT
- How can I implement an Add to Collection function on my Image Gallery to be downloaded later?
- Gravity Forms plugin: How to use “gform_editor_js” action hook? [closed]
- Add Piecemaker to WordPress Header
- Filtering out specific post formats from certain pages
- Plugin updates from a specific location
- Calling plugin function inside custom plugin for onclick event
- How to fix wrong attribute error for Visual Composer Grid Builder?
- 306 MB of wp_options occupied by WordPress SEO Plugin, is that normal? [closed]
- html generated by theme exist but doesnt appear in browser
- dirname( __FILE__) returning wrong directory inside plugin
- How to execute code only on posts older than 2 weeks
- Does plugin’s uninstall.php file have access to the plugin ‘s object?
- Related posts widget or plugin needed
- Use $_GET inside a shortcode print empty Array
- Implementing an “Email this” button?
- Use conditional logic for woocommerce variable product
- How to customize a title by passing query string?
- Remove Advanced Custom Fields plugin for client?
- How to check if an email was sent from or originated from a specific plugin?
- Gutenberg Blocks – Cannot retrieve block saved attributes in edit post
- How to add fields in the WordPress editor?
- Migrating WordPress – New domain entry, links broken
- Search Results Page filter by page title
- Activate and deactivate plugin automatically
- WooCommerce: after install hook
- Get param from shortcode in plugin function
- Is there a better way of handling AJAX requests in WordPress?
- Change website directory safely to add a static page on startup
- add_meta_box creating default form field types
- Plugin permissions for Editor role
- How to add an admin alert for missing plugins
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- After installing JetPack, can I delete the WordPress stats plugin?
- how to render dashboard widgets conditionaly in wordpress admin
- Redirect plugin after form submit or show errors
- how to create hierachial taxonomy and manage under single post type?
- Button and Countdown overlapping mobile menu
- How to data add to table when update post wordpress? when we clicked!
- Check if theme supports sidebar
- Change plugin descriptions
- update_option_{$option} not working (do function after options are saved)
- Looking for WordPress PDF Converter with Custom Templates?
- How get horizontal div instead vertical CSS
- Out of date plugins not showing ugrade link
- Use Case: Multiple Shipping Methods per Order
- Showing how many times is plugin activated or deactivated
- Can’t add or delete plugins – but I’m an admin [closed]
- WordPress Categories as a Grid
- get/show Last ID
- Why is WP template_include overwritting all templates rather than specified page?
- What is the best practice for making a WP plugin that I want to develop responsive?
- Form tries to download a file on submit
- Undefined index – get_option
- Auto-login from backend
- Plugins don’t show up after renaming plugins folder
- How to prevent query strings persisting on certain page templates
- Use of apply_filter in plugin/widget class
- Edit Buddypress Groups Activity Page Text [closed]
- GravityForms to Salesforce API, problem with people who leave out company [closed]
- Access to wordpress method inside of classes
- Activate plugins by a theme’s functions.php?
- WordPress User Portal
- How to include a custom thumbnail with my WordPress plugin?
- ACF Plugin WP with list-group – Vimeo [closed]
- How can i display portfolio images in WordPress?
- Can anyone tell some online tuts for plugin development for beginner? [closed]
- Slider Plugins for header [closed]
- iframe not showing on frontend when using a CMB2 field
- Custom priority with the_content filter based on user input
- Links not opening as they should. Custom WP plugin
- Is website for online game guides doable in WordPress? [closed]
- filter just a portion of plugin function
- upload_mimes is getting ingored, how to add a new mime type?
- Hide attributes based on previous selection
- search by meta field in the regular WordPress admin panel search