Changeset 9180 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 10/15/2019 06:53:44 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r8913 r9180 1105 1105 wp_cache_add_global_groups( array( 'locale-associations' ) ); 1106 1106 1107 // Google doesn't have support for a whole lot of languages and throws errors about it, 1108 // so we exclude them, as we're otherwise outputting data that isn't used at all. 1109 $unsupported_languages = array( 1110 'arq', 1111 'art', 1112 'art-xemoji', 1113 'ary', 1114 'ast', 1115 'az-ir', 1116 'azb', 1117 'bcc', 1118 'ff-sn', 1119 'frp', 1120 'fuc', 1121 'fur', 1122 'haz', 1123 'ido', 1124 'io', 1125 'kab', 1126 'li', 1127 'li-nl', 1128 'lmo', 1129 'me', 1130 'me-me', 1131 'rhg', 1132 'rup', 1133 'sah', 1134 'sc-it', 1135 'scn', 1136 'skr', 1137 'srd', 1138 'szl', 1139 'tah', 1140 'twd', 1141 'ty-tj', 1142 'tzm', 1143 ); 1144 1145 // WARNING: for any changes below, check other uses of the `locale-assosciations` group as there's shared cache keys in use. 1107 1146 if ( false === ( $sites = wp_cache_get( 'local-sites', 'locale-associations' ) ) ) { 1108 1147 global $wpdb; … … 1115 1154 require_once GLOTPRESS_LOCALES_PATH; 1116 1155 1117 foreach ( $sites as $ site ) {1156 foreach ( $sites as $key => $site ) { 1118 1157 $gp_locale = GP_Locales::by_field( 'wp_locale', $site->locale ); 1119 1158 if ( ! $gp_locale ) { 1120 unset( $sites[ $site->locale ] ); 1159 unset( $sites[ $key ] ); 1160 continue; 1161 } 1162 1163 // Skip non-existing subdomains, e.g. 'de_CH_informal'. 1164 if ( false !== strpos( $site->subdomain, '_' ) ) { 1165 unset( $sites[ $key ] ); 1166 continue; 1167 } 1168 1169 // Skip unsupported locales. 1170 if ( in_array( $gp_locale->slug, $unsupported_languages ) ) { 1171 unset( $sites[ $key ] ); 1121 1172 continue; 1122 1173 } … … 1135 1186 } 1136 1187 1137 if ( $hreflang && 'art' !== $hreflang) {1138 $sites[ $ site->locale]->hreflang = strtolower( $hreflang );1188 if ( $hreflang ) { 1189 $sites[ $key ]->hreflang = strtolower( $hreflang ); 1139 1190 } else { 1140 unset( $sites[ $ site->locale] );1191 unset( $sites[ $key ] ); 1141 1192 } 1142 1193 }
Note: See TracChangeset
for help on using the changeset viewer.