I can iterate through the top level Wordpress menu items to change the name but I now need to iterate through the sub menu items of that menu. I know I can do it using exact values $submenu['edit.php'][5][0] = 'New Label'; but it's for a plugin where the menu item may not be in the same position every time so that won't work.
I've got this code for the top level menus.
function _rename_top_level_menu( $original, $new ) {
global $menu;
foreach( $menu as $key => $value ) {
if( $original === $value[0]) {
$menu[$key][0] = $new;
}
}
}