From 635e50d9a193bca7de397e29ad8c91010fd4eb6d Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 21 Feb 2014 18:14:14 +0000 Subject: [PATCH] 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 --- wp-includes/nav-menu.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/nav-menu.php b/wp-includes/nav-menu.php index af69dfc897..1672b03b8a 100644 --- a/wp-includes/nav-menu.php +++ b/wp-includes/nav-menu.php @@ -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;