Making WordPress.org


Ignore:
Timestamp:
01/12/2016 05:44:47 PM (11 years ago)
Author:
ocean90
Message:

Translate: Cache the output of GP::$translation_set->existing_locales() for the locales overview.

The underlying query can take up to 3 seconds. :-(

See #1352.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/cli/update-caches.php

    r2278 r2280  
    1111                $this->contributors_count();
    1212                $this->translation_status();
     13                $this->existing_locales();
    1314        }
    1415
     
    6869                WP_CLI::success( 'Translation status was updated.' );
    6970        }
     71
     72        /**
     73         * Update cache for existing locales.
     74         *
     75         * @subcommand existing-locales
     76         */
     77        public function existing_locales() {
     78                $existing_locales = GP::$translation_set->existing_locales();
     79
     80                wp_cache_set( 'existing-locales', $existing_locales, $this->cache_group );
     81                WP_CLI::success( 'Existing locales were updated.' );
     82        }
    7083}
Note: See TracChangeset for help on using the changeset viewer.