mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user