Changeset 5503 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php
- Timestamp:
- 05/21/2017 02:20:50 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php
r5502 r5503 220 220 */ 221 221 private function translation_set_slug_exists( $locale, $slug ) { 222 $cache_key = "translation_set_slugs:{$locale->slug}";222 /*$cache_key = "translation_set_slugs:{$locale->slug}"; 223 223 $slugs = wp_cache_get( $cache_key, $this->cache_group ); 224 224 … … 231 231 232 232 wp_cache_set( $cache_key, $slugs, $this->cache_group, DAY_IN_SECONDS ); 233 } 234 235 return in_array( $slug, $slugs, true ); 233 }*/ 234 235 // Hardcoded list because the query above doesn't perform well due to a missing index. 236 $slugs = [ 237 'default' => [ 238 'default', 239 ], 240 'de' => [ 241 'default', 242 'formal', 243 ], 244 'de-ch' => [ 245 'default', 246 'informal', 247 ], 248 'nl' => [ 249 'default', 250 'formal', 251 ], 252 'pt' => [ 253 'default', 254 'informal', 255 ], 256 ]; 257 258 if ( isset( $slugs[ $locale->slug ] ) ) { 259 return in_array( $slug, $slugs[ $locale->slug ], true ); 260 } 261 262 return in_array( $slug, $slugs['default'], true ); 236 263 } 237 264
Note: See TracChangeset
for help on using the changeset viewer.