mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-18 02:04:26 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user