Add custom admin menu in woocommerce

Can I add a new admin menu to the woocommerce admin section in Wordpress? I did this using WP E-commerce with my custom plugin, so I wander if the same is true for Woo trading.

thanks

+6
source share
2 answers

Well, if you use something like this:

add_action('admin_menu', 'register_my_custom_submenu_page'); 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>'; } 

Then you will see a submenu in the Woocommerce admin menu. For some reason you cannot do the same with post_type = shop_order.

"shop_order" is the one you should use to place the submenu under "Woocommerce" alone .. but, as I said, I don’t know why it didn’t work with this private post_type.

http://codex.wordpress.org/Function_Reference/add_submenu_page

+14
source

For me it worked:

 add_submenu_page( 'edit.php?post_type=product', PAGE_TITLE, MENU_TITLE, 'manage_woocommerce', 'custom_wc_menu' ); 

Setting $ parent_slug in edit.php?post_type=product

+3
source

Source: https://habr.com/ru/post/946549/


All Articles