Changeset 8553
- Timestamp:
- 03/29/2019 06:11:54 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/class-plugin.php
r8249 r8553 208 208 FROM {$wpdb->project_translation_status} 209 209 WHERE `project_id` = %d AND `locale_slug` = %s", 210 2, 'default' // 2 = wp/dev 210 2, // 2 = wp/dev 211 'default' 211 212 ), OBJECT_K ); 212 213 … … 228 229 } 229 230 230 $locales = GP::$translation_set->existing_locales();231 $locales = $this->get_existing_locales(); 231 232 $db_counts = $wpdb->get_results( 232 233 "SELECT `locale`, COUNT( DISTINCT user_id ) as `count` FROM {$wpdb->user_translations_count} WHERE `accepted` > 0 GROUP BY `locale`", … … 251 252 252 253 /** 254 * Retrieves existing locales of the main wp/dev project. 255 * 256 * Much faster alternative to `GP::$translation_set->existing_locales();` since it avoids 257 * the expensive DISTINCT. 258 * 259 * @return array List of GlotPress locales. 260 */ 261 private function get_existing_locales() { 262 global $wpdb; 263 264 return $wpdb->get_col( 265 $wpdb->prepare( 266 "SELECT locale FROM {$wpdb->gp_translation_sets} WHERE `project_id` = %d and slug = %s", 267 2, // 2 = wp/dev 268 'default' 269 ) 270 ); 271 } 272 273 /** 253 274 * Updates cache for existing locales. 254 275 */ 255 276 public function update_existing_locales_cache() { 256 $existing_locales = GP::$translation_set->existing_locales(); 257 277 $existing_locales = $this->get_existing_locales(); 258 278 if ( ! $existing_locales ) { 259 279 return;
Note: See TracChangeset
for help on using the changeset viewer.