Ticket #32630: 32630.diff
| File 32630.diff, 1.0 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/nav-menu.php
146 146 * @return bool Whether location has a menu. 147 147 */ 148 148 function has_nav_menu( $location ) { 149 $has_nav_menu = false; 150 149 151 $registered_nav_menus = get_registered_nav_menus(); 150 if ( ! isset( $registered_nav_menus[ $location ] ) ) { 151 return false; 152 if ( isset( $registered_nav_menus[ $location ] ) ) { 153 $locations = get_nav_menu_locations(); 154 $has_nav_menu = ( ! empty( $locations[ $location ] ) ); 152 155 } 153 156 154 $locations = get_nav_menu_locations(); 155 return ( ! empty( $locations[ $location ] ) ); 157 /** 158 * Filter whether a nav menu is assigned to the specified location. 159 * 160 * @since 4.3.0 161 * 162 * @param bool $has_nav_menu Whether there is a menu assigned to a location. 163 * @param string $location Menu location. 164 */ 165 $has_nav_menu = apply_filters( 'has_nav_menu', $has_nav_menu, $location ); 166 167 return $has_nav_menu; 156 168 } 157 169 158 170 /**