Making WordPress.org


Ignore:
Timestamp:
03/30/2015 10:44:22 AM (9 years ago)
Author:
ocean90
Message:

Translations API: Use only active translations for update checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/translations/lib.php

    r1218 r1466  
    2323    $cache_time = 900; // 15 min
    2424    $cache_key = "$type:$domain:$version";
    25    
     25
    2626    $translations = wp_cache_get( $cache_key, $cache_group );
    2727    if ( '_empty_' === $translations ) {
     
    101101            $key .= ++$i;
    102102        }
    103    
     103
    104104        $_translations[ $key ] = $translation;
    105105        $_translations[ $key ]->english_name = $locale->english_name;
     
    150150        if ( ! $results ) {
    151151            $query = $wpdb->prepare(
    152                 "SELECT `version`, `updated` FROM `language_packs` WHERE `type` = %s AND `domain` = %s AND `language` = %s",
     152                "SELECT `version`, `updated` FROM `language_packs` WHERE `type` = %s AND `domain` = %s AND `language` = %s AND `active` = 1",
    153153                $type, $domain, $language );
    154154            $results = $wpdb->get_results( $query, ARRAY_A );
     
    162162        usort( $results, 'version_compare_version_key_desc' );
    163163        if ( $version ) {
    164             $found = false;         
     164            $found = false;
    165165            foreach ( $results as $result ) {
    166166                if ( version_compare( $result['version'], $version, '<=' ) ) {
Note: See TracChangeset for help on using the changeset viewer.