WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#32630 closed feature request (fixed)

Introduce has_nav_menu filter

Reported by: westonruter Owned by: ocean90
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.0
Component: Menus Keywords: has-patch
Focuses: Cc:

Description

For Menu Customizer (#32576) to preview changes with partial refresh, we need to know which menu locations are used on a given template. In Twenty Fifteen, the wp_nav_menu calls are wrapped in a has_hav_menu() checks, meaning that the hooks that fire in wp_nav_menu will not be triggered if there was no menu assigned to the location up-front. So in the same way that we have a is_sidebar_active() function and a corresponding is_active_sidebar filter, we also should have a has_nav_menu filter accompany the has_hav_menu() function.

Attachments (1)

Change History (5)

#1 @westonruter
4 years ago

  • Keywords has-patch added

#2 @ocean90
4 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 32746:

Nav menu: Introduce a has_nav_menu filter in has_nav_menu() to filter whether a nav menu is assigned to a specified location.

props westonruter.
fixes #32630.

#3 @akibjorklund
3 years ago

#31525 was marked as a duplicate.

#4 @swissspidy
3 years ago

#31525 was marked as a duplicate.

Note: See TracTickets for help on using tickets.