Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save KennethEhmsen/f7a03c1a1bcf13eeb88059f30ed1b2a4 to your computer and use it in GitHub Desktop.
Save KennethEhmsen/f7a03c1a1bcf13eeb88059f30ed1b2a4 to your computer and use it in GitHub Desktop.
<?php
/*
* Rename Woocommece Admin Menu
*/
add_action( 'admin_menu', 'rename_woocoomerce_wpse_100758', 999 );
function rename_woocoomerce_wpse_100758()
{
global $menu;
// Pinpoint menu item
$woo = recursive_array_search_php_91365( 'WooCommerce', $menu );
// Validate
if( !$woo )
return;
$menu[$woo][0] = 'Store Settings';
}
function recursive_array_search_php_91365( $needle, $haystack )
{
foreach( $haystack as $key => $value )
{
$current_key = $key;
if(
$needle === $value
OR (
is_array( $value )
&& recursive_array_search_php_91365( $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