Opened 9 years ago
Closed 22 months ago
#36745 closed enhancement (invalid)
_wp_menu_item_classes_by_context
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | has-patch dev-feedback has-unit-tests |
Focuses: | performance | Cc: |
Description
_wp_menu_item_classes_by_context currently uses wp_get_object_terms. wp_get_object_terms has no caching in the function. get_the_terms function does have caching and should be used in this context.
Attachments (3)
Change History (11)
This ticket was mentioned in Slack in #core by spacedmonkey. View the logs.
9 years ago
#4
@
9 years ago
- Keywords dev-feedback has-unit-tests added
- Type changed from defect (bug) to enhancement
Unit tests added. The unit tests should prove that the caching is working on single post pages.
#5
@
9 years ago
Looking at this patch, a couple of line above it, it checks it is_taxonomy_hierarchical. It should really also check to see if the taxonomy is public. I can't think of a example where an underline would be needed for a non public taxonomy.
#6
@
9 years ago
Added a new patch. This one adds a check to see that the taxonomy is public. This will decrease the number of calls to cache / db for none public taxonomies.
I have changed this from enhancement to a bug. The fact that it doesn't use the caching function can be a massive performance issue, if there are lots of taxonomies and menu items. I believe this fix should go in the 4.5.2 release.