forked from WordPress/WordPress
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a more reliable method for generating
get_terms()
cache key.
Previously, the cache key included a serialization of `list_terms_exclusions` callbacks, to ensure that the cache was differentiated properly for different uses of the `list_terms_exclusions` filter. This strategy was flawed in a couple of ways: serialization doesn't work equally well for all callable types; the serialization required reaching into the `$wp_filter` global; serializing the callback itself didn't properly account for the possibility that the callback might return different values in different contexts; the cache key didn't account for other filters that similarly affect the cached values, such as `terms_clauses`. We skirt all these issues by concatenating the cache key using the SQL query string, which will reflect all filters applied earlier in `get_terms()`. Props boonebgorges, wonderboymusic. Fixes #21267. Built from https://develop.svn.wordpress.org/trunk@35120 git-svn-id: http://core.svn.wordpress.org/trunk@35085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Loading branch information
1 parent
bac64cc
commit cd563fd
Showing
2 changed files
with
27 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters