WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/28/2014 09:04:52 PM (6 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r30058 r30073  
    47434743    return (bool) $var;
    47444744}
    4745 
    4746 /**
    4747  * Helper function to retrieve an incrementer identified by $group
    4748  *
    4749  * @since 4.1.0
    4750  *
    4751  * @param string $group The cache group for the incrementer.
    4752  * @param bool $force Whether or not to generate a new incrementor.
    4753  * @return int The timestamp representing 'last_changed'.
    4754  */
    4755 function wp_get_last_changed( $group, $force = false ) {
    4756     $last_changed = wp_cache_get( 'last_changed', $group );
    4757     if ( ! $last_changed || true === $force ) {
    4758         $last_changed = microtime();
    4759         wp_cache_set( 'last_changed', $last_changed, $group );
    4760     }
    4761     return $last_changed;
    4762 }
Note: See TracChangeset for help on using the changeset viewer.