Opened 10 years ago
Closed 3 years ago
#36745 closed enhancement (invalid)
_wp_menu_item_classes_by_context
| Reported by: | spacedmonkey | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Menus | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch dev-feedback has-unit-tests |
| Cc: | Focuses: | performance |
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.
10 years ago
#4
@
10 years ago
- Keywords dev-feedback has-unit-tests added
- Type defect (bug) → enhancement
Unit tests added. The unit tests should prove that the caching is working on single post pages.
#5
@
10 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
@
10 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.