Remove theme support for 'menus' in unregister_nav_menu() when there are no more menus.

props kovshenin.
fixes #26900.

Built from https://develop.svn.wordpress.org/trunk@27220


git-svn-id: http://core.svn.wordpress.org/trunk@27077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-02-21 18:14:14 +00:00
parent 912379a022
commit 635e50d9a1
1 changed files with 3 additions and 0 deletions

View File

@ -90,6 +90,9 @@ function unregister_nav_menu( $location ) {
if ( is_array( $_wp_registered_nav_menus ) && isset( $_wp_registered_nav_menus[$location] ) ) {
unset( $_wp_registered_nav_menus[$location] );
if ( empty( $_wp_registered_nav_menus ) ) {
_remove_theme_support( 'menus' );
}
return true;
}
return false;