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

props kovshenin.
fixes #26900.


git-svn-id: https://develop.svn.wordpress.org/trunk@27220 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-02-21 18:13:52 +00:00
parent 4cfcdabdd8
commit b74f222d33
2 changed files with 30 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;