Make WordPress Core

Opened 7 years ago

Last modified 3 years ago

#31391 new enhancement

Make the list of registered nav menus filterable

Reported by: csschris Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6
Component: Menus Keywords: has-patch needs-docs needs-unit-tests
Focuses: administration Cc:


Adding a filter to the list of registered menu locations before they are displayed in the admin section allows for easy reordering and/or selectively hiding menu locations to none admin users.

Attachments (1)

31391.patch (480 bytes) - added by csschris 7 years ago.

Download all attachments as: .zip

Change History (5)

7 years ago

#1 @DrewAPicture
7 years ago

  • Keywords has-patch added
  • Summary changed from Apply Filter for list of registered menu theme locations in nav-menus.php?action=locations to Make the list registered nav menus filterable
  • Version changed from trunk to 3.6

#2 @SergeyBiryukov
7 years ago

  • Focuses multisite removed
  • Summary changed from Make the list registered nav menus filterable to Make the list of registered nav menus filterable

#3 @csschris
7 years ago

The call to get_registered_nav_menus() is done multiple times throughout wp-admin/nav-menus.php If approved, every call on the page should probably get filtered. My submitted patch only changes it in one place.

#4 @welcher
5 years ago

  • Keywords needs-docs needs-unit-tests added

The patch still applies but we need some inline docs - https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#4-hooks-actions-and-filter.

I would implement the filter everywhere it needs to go so the patch represents the entire change set and some unit tests couldn't either.

Note: See TracTickets for help on using tickets.