Re-order WordPress Admin Sub-menu Items
If you’re wanting to push your custom sub-menu link to the top of the list within a WordPress menu, you can use this code to ensure that you’re always the alpha sub-menu item.
function custom_menu_order(){ global $submenu; $find_page = 'themes.php'; $find_sub = 'Widgets'; foreach($submenu as $page => $items): if($page == $find_page): foreach($items as $id => $meta): if($meta[0] == $find_sub): $submenu[$find_page][0] = $meta; unset ($submenu[$find_page][$id]); ksort($submenu[$find_page]); endif; endforeach; endif; endforeach; } add_action('_admin_menu', 'custom_menu_order');
View the SE thread where I originally posted this.