This is what I do to rename menu items: in the action hook admin_menu
, use a recursive array search to pinpoint the key position of the desired menu and then modify the global $menu
array.
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';
}
// http://www.php.net/manual/en/function.array-search.php#91365
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;
}