[wp-trac] [WordPress Trac] #37094: wp_get_nav_menu_items should use tax_query

WordPress Trac noreply at wordpress.org
Wed Jun 21 04:43:27 UTC 2017


#37094: wp_get_nav_menu_items should use tax_query
-----------------------------------+--------------------------
 Reporter:  spacedmonkey           |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  4.9
Component:  Menus                  |     Version:  3.0
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  performance
-----------------------------------+--------------------------

Comment (by boonebgorges):

 Replying to [comment:6 spacedmonkey]:
 > By using the tax query and tt_id, it results in on extra query. However,
 if the site has lots of terms and linked, I could understand it might be
 slow. However, this is a general problem with the tax query.
 >
 > Personally, I would use the tax query and work on #22176 and #37038
 tickets. In short, do this query in the wordpress way (a tax query) and
 make the rest of the core better around it.

 #37038 eliminates the transform, but the transform is not the problematic
 query here: it's the `wp_posts` + `wp_term_relationships` table join.
 You're correct that this is a general problem with tax query, but it's
 also the case that tax queries are generally only fired by core in
 specific places: taxonomy archives, etc. Nav queries are fired on pretty
 much every page, sometimes multiple times, so we've got to be much more
 careful about them.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37094#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list