Changeset 7898 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
- Timestamp:
- 11/26/2018 04:51:14 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php
r7600 r7898 1090 1090 */ 1091 1091 function wporg_themes_add_hreflang_link_attributes() { 1092 if ( is_404() ) { 1093 return; 1094 } 1095 1092 1096 wp_cache_add_global_groups( array( 'locale-associations' ) ); 1093 1097 … … 1136 1140 ); 1137 1141 1142 // Add x-default to the list of sites. 1143 $sites['x-default'] = (object) array( 1144 'locale' => 'x-default', 1145 'hreflang' => 'x-default', 1146 'subdomain' => '', 1147 ); 1148 1138 1149 uasort( $sites, function( $a, $b ) { 1139 1150 return strcasecmp( $a->hreflang, $b->hreflang ); … … 1141 1152 1142 1153 wp_cache_set( 'local-sites', $sites, 'locale-associations' ); 1154 } 1155 1156 if ( is_singular() ) { 1157 $path = parse_url( get_permalink(), PHP_URL_PATH ); 1158 } else { 1159 // WordPress doesn't have a good way to get the canonical version of non-singular urls. 1160 $path = $_SERVER['REQUEST_URI']; // phpcs:ignore 1143 1161 } 1144 1162 … … 1147 1165 'https://%swordpress.org%s', 1148 1166 $site->subdomain ? "{$site->subdomain}." : '', 1149 $ _SERVER[ 'REQUEST_URI' ]1167 $path 1150 1168 ); 1151 1169
Note: See TracChangeset
for help on using the changeset viewer.