Recently WordPress had updated there new default Theme 2010 to version 1.1 and as most WordPress users who are using that Theme you would go and update and download the new Theme version.
One thing got me thinking about how when a user gets notified on a plugin, there is a counter displaying how many plugins need updating. So why not have the Themes menu act the same way.
I did a little digging in the ‘wp-admin’ folder and searched for the ‘menu.php’ file and located where the Plugin menu was. I then copied the same function for the Themes menu and was able to get a counter for any Themes that need updating.
When I first looked at the change in my control panel, it was unable to fit fully. So now that we got the function to work we need to get the counter to fit properly with the label of the menu.
I altered the word ‘Appearance’ and changed it to ‘Themes’ and that was it. Now we can be notified just on how many Themes need updating.


Copy and Paste the code below in the appropriate location to replace in the ‘menu.php’ file under ‘wp-admin’ and save.
$update_themes = get_site_transient( 'update_themes' );
$update_count = 0;
if ( !empty($update_themes->response) )
$update_count = count( $update_themes->response );
if ( current_user_can( 'switch_themes') ) {
$menu[60] = array( sprintf( __('Themes %s'), "<span class='update-plugins count-$update_count'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
$submenu['themes.php'][5] = array(__('Themes'), 'switch_themes', 'themes.php');
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php');
} else {
$menu[60] = array( sprintf( __('Themes %s'), "<span class='update-plugins count-$update_count'><span class='update-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
$submenu['themes.php'][5] = array(__('Themes'), 'edit_theme_options', 'themes.php');
if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
$submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' );
}
Upload the altered file to your server in the ‘wp-admin’ folder and your done. Enjoy!
If you have any comments about this please leave them below. Any one is welcome to try and convert it to a plugin or ask Matt Mullenweg to make this change in an upcoming WordPress update.
Continue Reading