[wp-trac] [WordPress Trac] #27113: Explicitly assign menu term relationship in wp_update_nav_menu_item() instead of using "tax_input" argument
WordPress Trac
noreply at wordpress.org
Wed Feb 12 20:28:21 UTC 2014
#27113: Explicitly assign menu term relationship in wp_update_nav_menu_item()
instead of using "tax_input" argument
-----------------------------+------------------------------
Reporter: danielbachhuber | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------------------
Comment (by nacin):
You removed a comment there, "Only set the menu term if it isn't set to
avoid unnecessary wp_get_object_terms()".
Basically, that is_object_in_term() call was added for the purposes of
reducing queries (which nav menus use a ton of). is_object_in_term() uses
the term cache, while wp_set_object_terms() does not, by way of
wp_get_object_terms().
> the code didn't and doesn't support updating the associated menu_id of a
menu item.
I believe you, but it's not obvious why this is the case. Could you
explain?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27113#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list