Commit e1b18757 authored by Andrew Nacin's avatar Andrew Nacin
Browse files

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: https://core.svn.wordpress.org/trunk@27077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent c5212fe1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;