WooCommerce : Add New Page and Link it to WordPress > Products.

For Adding a submenu to any admin menu we must know the parentslug of admin menu.

For adding submenu to Woocomerce product menu we have to use ‘edit.php?post_type=product’ as parent slug.

For example:

function ProductsSubPage() {
  add_submenu_page( 'edit.php?post_type=product', 'Custom Page Title', 'New Custom Title', 'edit_products', 'new_page_slug', 'ProductsSubPageCallback', 99 );
}
function ProductsSubPageCallback() {
  echo '<div class="wrap"><h1 class="">New Custom Title</h1>';
  // add Content here
  echo '</div>';
}
add_action( 'admin_menu', 'ProductsSubPage', 99 );

//output
null

Enjoy

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top