Changeset 2280
- Timestamp:
- 01/12/2016 05:44:47 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/cli/update-caches.php
r2278 r2280 11 11 $this->contributors_count(); 12 12 $this->translation_status(); 13 $this->existing_locales(); 13 14 } 14 15 … … 68 69 WP_CLI::success( 'Translation status was updated.' ); 69 70 } 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 } 70 83 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/routes/index.php
r2109 r2280 7 7 class WPorg_GP_Route_Index extends GP_Route { 8 8 9 private $cache_group = 'wporg-translate'; 10 9 11 /** 10 12 * Prints all exisiting locales as cards. 13 * 14 * Note: Cache gets refreshed via `WPorg_GP_CLI_Update_Caches`. 11 15 */ 12 16 public function get_locales() { 17 $existing_locales = wp_cache_get( 'existing-locales', $this->cache_group ); 18 if ( false === $existing_locales ) { 19 $existing_locales = array(); 20 } 21 13 22 $locales = array(); 14 $existing_locales = GP::$translation_set->existing_locales();15 23 foreach ( $existing_locales as $locale ) { 16 24 $locales[] = GP_Locales::by_slug( $locale ); … … 19 27 unset( $existing_locales ); 20 28 21 $contributors_count = wp_cache_get( 'contributors-count', 'wporg-translate');29 $contributors_count = wp_cache_get( 'contributors-count', $this->cache_group ); 22 30 if ( false === $contributors_count ) { 23 31 $contributors_count = array(); 24 32 } 25 33 26 $translation_status = wp_cache_get( 'translation-status', 'wporg-translate');34 $translation_status = wp_cache_get( 'translation-status', $this->cache_group ); 27 35 if ( false === $translation_status ) { 28 36 $translation_status = array();
Note: See TracChangeset
for help on using the changeset viewer.