[wp-trac] [WordPress Trac] #37586: customize_nav_menu_available_item_types should filter even search results

WordPress Trac noreply at wordpress.org
Fri Aug 5 16:36:51 UTC 2016


#37586: customize_nav_menu_available_item_types should filter even search results
--------------------------+-----------------------------
 Reporter:  virgodesign   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  4.5.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 {{{customize_nav_menu_available_item_types}}} is a filter located in
 {{{class-wp-customize-nav-menus.php}}}.

 The purpouse of this filter is to restrict item types available in the
 Menu Customizer.

 This filter should be applied even if I perform a research using the
 search field in Menu Customizer.
 But this does not happens.

 While in Menu Customizer, doing a research, in search results shows up
 even items of specific types excluded with
 {{{customize_nav_menu_available_item_types}}} filter.

 We can resolve this issue using another filter always located in the same
 class: the {{{customize_nav_menu_searched_items}}} filter.
 With this filter we can restrict the selections of items received from the
 search result just before sending them to the frontend (ajax response).

 But this could be considered only a workaround and not a solution, because
 items should be filtered/excluded by type BEFORE wordpress performs the
 query to the database.

 We should suppose that, if we uses the
 {{{customize_nav_menu_available_item_types}}} to filter item types
 available on Menu Customizer, most likely we do not want search for
 elements of theese item types.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37586>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list