mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-12 14:49:55 +01:00
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:
parent
912379a022
commit
635e50d9a1
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user