Making WordPress.org


Ignore:
Timestamp:
06/16/2016 12:46:27 PM (8 years ago)
Author:
ocean90
Message:

Theme/Plugin Directory: Use a global cache group for locale associations.

Cache gets invalidated when a locale is added or deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r3387 r3388  
    10631063 */
    10641064function wporg_themes_add_hreflang_link_attributes() {
    1065     $sites = wp_cache_get( 'local-sites', 'locale-associations' );
    1066 
    1067     if ( false === $sites ) {
     1065    wp_cache_add_global_groups( array( 'locale-associations' ) );
     1066
     1067    if ( false === ( $sites = wp_cache_get( 'local-sites', 'locale-associations' ) ) ) {
    10681068        global $wpdb;
     1069
    10691070        $sites = $wpdb->get_results( 'SELECT locale, subdomain FROM locales', OBJECT_K );
    10701071        if ( ! $sites ) {
     
    11101111        } );
    11111112
    1112         wp_cache_set( 'local-sites', $sites, 'locale-associations', DAY_IN_SECONDS );
     1113        wp_cache_set( 'local-sites', $sites, 'locale-associations' );
    11131114    }
    11141115
Note: See TracChangeset for help on using the changeset viewer.