If you’re developing custom WooCommerce documentation, reporting or functionalities for your clients, you probably also need to add a new “page” and a new “submenu link” to the WordPress Admin Dashboard.

This is a very interesting topic and in the same way you can hide elements, you can also add new ones. In my case, I had to implement a custom, admin-only form to enable product recommendations. Enjoy 🙂

Add a new WordPress Admin Dashboard page under “Products”

PHP snippet: Add New Page and Menu Link to WordPress > Products Dashboard

/**
 * @snippet       New WooCommerce/Products Admin Page
 * @how-to        Get CustomizeWoo.com FREE
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.5.6
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */

add_action( 'admin_menu', 'bbloomer_wp_dashboard_products_new_page', 9999 );

function bbloomer_wp_dashboard_products_new_page() {
	add_submenu_page( 'edit.php?post_type=product', 'New Page Title', 'New Page Menu Title', 'edit_products', 'new_page_slug', 'bbloomer_wp_dashboard_products_new_page_callback', 9999 );
}

function bbloomer_wp_dashboard_products_new_page_callback() {
	echo '<div class="wrap"><h1 class="">New Page Title</h1>';
	// add your your HTML, PHP, CSS, jQUERY here
	echo '</div>';
}
Share:

Leave a Reply