Based on Change WooCommerce products menu title in WordPress admin dashboard answer by 7uc13r, I am trying to understand how to change WooCommerce
into Store
.
I've tried with the following, without success:
#1: Debug, show the menu array on dashboard
function debug_admin_menus() {
global $menu, $submenu, $pagenow;
if ( current_user_can('manage_options') ) {
if( $pagenow == 'index.php' ) { // print on dashboard
echo '<pre>', print_r( $menu, 1 ), '</pre>'; // top level menus
echo '<pre>', print_r( $submenu, 1 ), '</pre>'; // submenus
}
}
}
add_action( 'admin_notices', 'debug_admin_menus' );
#2: change the name and submenu name (WooCommerce won't change, "All products" does)
function custom_change_admin_label() {
global $menu, $submenu;
$menu[70][0] = 'Store';
$submenu['edit.php?post_type=product'][5][0] = 'All Plugins';
}
add_action( 'admin_menu', 'custom_change_admin_label' );