[wp-trac] [WordPress Trac] #37094: wp_get_nav_menu_items should use tax_query
WordPress Trac
noreply at wordpress.org
Mon May 29 18:41:09 UTC 2017
#37094: wp_get_nav_menu_items should use tax_query
----------------------------------------+------------------------------
Reporter: spacedmonkey | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: performance
----------------------------------------+------------------------------
Comment (by spacedmonkey):
I have done some profiling and I updated the patch.
@ocean90 I didn't manage to replicate your error message. I don't see how
there is a problem, tax_query is a well tested part of core. The only
reason it didn't use tax_query when this function was created, was because
it didn't exists.
I have uploaded some screenshots from my profiling. It shows the change in
queries generated. The new patch, results in one less query per menu call.
By passing the term_taxonomy_id, the tax_query doesn't need to look
anything up in the database, resulting in one less query.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37094#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list