Adjust caching for get_term_by() calls:

* Remove md5 hashes for term name cache keys
* Remove the namespace for the keys for `names` and `slugs` and add them to the group names
* Remove `wp_get_last_changed()`, which @nacin hated
 
Props tollmanz.
Fixes #21760.


git-svn-id: https://develop.svn.wordpress.org/trunk@30073 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-10-28 21:04:52 +00:00
parent e5275dcedb
commit 1e8635fcea
2 changed files with 19 additions and 36 deletions

View File

@@ -4742,21 +4742,3 @@ function wp_validate_boolean( $var ) {
return (bool) $var;
}
/**
* Helper function to retrieve an incrementer identified by $group
*
* @since 4.1.0
*
* @param string $group The cache group for the incrementer.
* @param bool $force Whether or not to generate a new incrementor.
* @return int The timestamp representing 'last_changed'.
*/
function wp_get_last_changed( $group, $force = false ) {
$last_changed = wp_cache_get( 'last_changed', $group );
if ( ! $last_changed || true === $force ) {
$last_changed = microtime();
wp_cache_set( 'last_changed', $last_changed, $group );
}
return $last_changed;
}