Changeset 7909
- Timestamp:
- 11/27/2018 08:28:49 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/utilities/class-genderize-client.php
r7882 r7909 13 13 */ 14 14 class Genderize_Client extends API_Client { 15 15 /** 16 * @var string The option key where the cache is saved in the database. 17 */ 16 18 const CACHE_KEY = 'genderize_cached_data'; 17 19 … … 70 72 71 73 if ( true === $this->options->reset_cache ) { 72 $this->cache = []; 73 $this->save_cached_data(); 74 delete_option( self::CACHE_KEY ); 74 75 } 75 76 } … … 84 85 */ 85 86 public function get_gender_data( array $names, $locale ) { 87 $names = array_unique( array_map( 'strtolower', $names ) ); 88 $lang_code = $this->get_lang_code_from_locale( $locale ); 89 86 90 // Bail if there are errors. 87 91 if ( ! empty( $this->error->get_error_messages() ) ) { … … 91 95 $data = []; 92 96 $needs_update = []; 93 94 $names = array_unique( array_map( 'strtolower', $names ) );95 $lang_code = $this->get_lang_code_from_locale( $locale );96 97 97 98 foreach ( $names as $name ) { … … 173 174 } 174 175 175 return $ cache[ $lang_code ][ $name ];176 return $item; 176 177 } 177 178
Note: See TracChangeset
for help on using the changeset viewer.