Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amouratoglou/006604c10051644f614d8c2f00704b81 to your computer and use it in GitHub Desktop.
Save amouratoglou/006604c10051644f614d8c2f00704b81 to your computer and use it in GitHub Desktop.
Rename Woocommerce in Dashboard menu
// Rename WooCommerce to Store in the dashboard
// add this function to your functions.php file
// or create a plugin with it.
add_action( 'admin_menu', 'rename_woocoomerce', 999 );
function rename_woocoomerce()
{
global $menu;
// Pinpoint menu item
$woo = rename_woocommerce( 'WooCommerce', $menu );
// Validate
if( !$woo )
return;
$menu[$woo][0] = 'Store Settings';
}
function rename_woocommerce( $needle, $haystack )
{
foreach( $haystack as $key => $value )
{
$current_key = $key;
if(
$needle === $value
OR (
is_array( $value )
&& rename_woocommerce( $needle, $value ) !== false
)
)
{
return $current_key;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment