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:
- Use Notepad++ as HEX-Editor
- Creating 20,000 Posts or Pages using a .csv file?
- Upload specific images to specific folder
- Plugin (or Theme) containing its own Plugins?
- Plugin for sharing on social sites? [closed]
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- How to create extendable wordpress plugins
- How to add meta box to plugin admin page?
- Delete Custom Dashboard Widgets
- What exactly does $wp_filesystem->abspath() return?
- Specific post user permissions
- Adding a Wizard to My Plugin
- I can’t access wordpress functions from an ajax php call
- Get User ID from within a plugin
- Moving customized core code into plugins?
- Custom Post Type Statuses
- Why users disable the WordPress update?
- Plugin for “Was This Helpful” at end of post? [closed]
- $woocommerce->cart is null inside WordPress Rest API
- add_meta_box Callback not being called
- Adding a post shortcode to a page template?
- Looking for a solution – slightly convoluted problem
- Is it possible to use Snap Scrolling? [closed]
- send_headers don’t work on wordpress multisite
- Woocommerce sidebar not loading in theme
- Enable Full SSL for WordPress
- Disable a WordPress site
- how to retrieve wordpress event manager plugin’s event detail using php? [closed]
- Changing comments avatar
- How to arrange the order of plugins displaying under every post?
- WordPress plugin changelog RSS
- Retrieving a Value from a wp-database
- How to disable CSS rule in Twentythirteen style.css?
- Input with spaces in Shortcode attributes overwritten by defaults
- Theme’s default styles are overriding my plugin’s custom CSS
- Multiple Billing forms in WooCommerce (one billing form per product)
- External RSS feed to WordPress Portfolio
- WordPress metaboxes – textfield suggestion automatically populated
- How to tell which one of my plugins are paid or free?
- Would Gutenberg be considered a PlugIn?
- Is there a specific term for Plugins that are specified in a WordPress Post using Comments?
- Check if variable is set in filter
- White screen after plugins upgrade
- Child Themes and Updating Parent Theme
- How to write “alt” tag in image for wordpress code?
- How do I rename a category in the menu bar only?
- A plugin that downloads other plugins
- How to use template_include hook with form submission?
- Large amount image data transfer
- CMB2 field not showing on front end category page
- is it possible to hook every page style?
- translate “load more” button
- Redirect logged in user to somepage on every page view?
- I need a lightbox plugin that will apply to gallery [closed]
- Override translation of 1 word
- How to add a link to our wp.org profile from wordpress.org plugin page?
- How can I remove the welcome message generated by the New User Approve plugin?
- how to make a wplang for network fill automatically
- Adding a Tag Parameter / Filter to My Shortcode
- How to write to the plugin’s directory?
- Modify pages widget and make a plugin?
- Edit all $wp_scripts at once to $in_footer = false
- Ajax call not working in wordpress through a plugin
- Custom plugin places html head content in body
- Setting Author on CPT
- Cannot run script properly with my custom plugin
- Cookie value changes back to previous value after changing
- HTTP Error upload ( localhost )
- Hide Plugin Custom Post Type Menu Link
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- Highlight admin menu items that are parent of existing core items
- Set up new WordPress domain using unclear files
- Getting all woocommerce products from REST API call in plugin
- WP Rest Api GET method restriction on route, but POST method also works
- Cannot install plugins
- how does a plugin get active in wordpress
- How do I run my custom function in my plugin when a wordpress user is deleted?
- Page Contents showing in Footer Area
- Update (a function) post’s featured image as soon as $image_url changes
- Widget logic using woocommerce product category
- Using activated_plugin to run code
- Surviving WordPress and plugin updates
- How to order users alphabetically by name? in plugin UPME
- Space in WordPress Attribute Causing Problems
- Is it possible to setup Category wise Subsciption?
- WordPress Background Audio – Continous AutoPlay
- Why won’t the Comprehensive Google Map Plugin load?
- How to change a specific page to custom page?
- Being notified when some YouTube video in some post becomes unavailable
- How use Dynamic hyperlink on each wordpress post?
- Why do I get this “peer’s certificate issuer not recognised” error when trying to install a theme?
- How do I activate my child theme, as I do not see it in developer tools
- How to execute init or woocommerce_init only for checkout page
- wordpress jquery is not defined because the head tag is empty
- Questions about using Disqus or Jetpack for comments [closed]
- Any plugin/theme available which suits my requirement? [closed]
- Update post meta Rest Api
- cURL External API request displays content above other content on page
- A way to upload old html pages with all its assets via WordPress admin and to add a fixed menu on top of those (a la Wayback Machine)
- Problem moving to category posts page