Changeset 38870
- Timestamp:
- 10/23/2016 01:55:49 AM (8 years ago)
- Location:
- trunk/src/wp-content/themes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfifteen/functions.php
r38846 r38870 287 287 288 288 /** 289 * Add preconnect for Google Fonts. 290 * 291 * @since Twenty Fifteen 1.7 292 * 293 * @param array $urls URLs to print for resource hints. 294 * @param string $relation_type The relation type the URLs are printed. 295 * @return array URLs to print for resource hints. 296 */ 297 function twentyfifteen_resource_hints( $urls, $relation_type ) { 298 if ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { 299 if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { 300 $urls[] = array( 301 'href' => 'https://fonts.gstatic.com', 302 'crossorigin', 303 ); 304 } else { 305 $urls[] = 'https://fonts.gstatic.com'; 306 } 307 } 308 309 return $urls; 310 } 311 add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 ); 312 313 /** 289 314 * Add featured image as background image to post navigation elements. 290 315 * -
trunk/src/wp-content/themes/twentyfourteen/functions.php
r38093 r38870 277 277 } 278 278 add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); 279 280 /** 281 * Add preconnect for Google Fonts. 282 * 283 * @since Twenty Fourteen 1.9 284 * 285 * @param array $urls URLs to print for resource hints. 286 * @param string $relation_type The relation type the URLs are printed. 287 * @return array URLs to print for resource hints. 288 */ 289 function twentyfourteen_resource_hints( $urls, $relation_type ) { 290 if ( wp_style_is( 'twentyfourteen-lato', 'queue' ) && 'preconnect' === $relation_type ) { 291 if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { 292 $urls[] = array( 293 'href' => 'https://fonts.gstatic.com', 294 'crossorigin', 295 ); 296 } else { 297 $urls[] = 'https://fonts.gstatic.com'; 298 } 299 } 300 301 return $urls; 302 } 303 add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); 279 304 280 305 if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : -
trunk/src/wp-content/themes/twentythirteen/functions.php
r38093 r38870 190 190 } 191 191 add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' ); 192 193 /** 194 * Add preconnect for Google Fonts. 195 * 196 * @since Twenty Thirteen 2.1 197 * 198 * @param array $urls URLs to print for resource hints. 199 * @param string $relation_type The relation type the URLs are printed. 200 * @return array URLs to print for resource hints. 201 */ 202 function twentythirteen_resource_hints( $urls, $relation_type ) { 203 if ( wp_style_is( 'twentythirteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { 204 if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { 205 $urls[] = array( 206 'href' => 'https://fonts.gstatic.com', 207 'crossorigin', 208 ); 209 } else { 210 $urls[] = 'https://fonts.gstatic.com'; 211 } 212 } 213 214 return $urls; 215 } 216 add_filter( 'wp_resource_hints', 'twentythirteen_resource_hints', 10, 2 ); 192 217 193 218 /** -
trunk/src/wp-content/themes/twentytwelve/functions.php
r38093 r38870 157 157 } 158 158 add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' ); 159 160 /** 161 * Add preconnect for Google Fonts. 162 * 163 * @since Twenty Twelve 2.2 164 * 165 * @param array $urls URLs to print for resource hints. 166 * @param string $relation_type The relation type the URLs are printed. 167 * @return array URLs to print for resource hints. 168 */ 169 function twentytwelve_resource_hints( $urls, $relation_type ) { 170 if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) && 'preconnect' === $relation_type ) { 171 if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { 172 $urls[] = array( 173 'href' => 'https://fonts.gstatic.com', 174 'crossorigin', 175 ); 176 } else { 177 $urls[] = 'https://fonts.gstatic.com'; 178 } 179 } 180 181 return $urls; 182 } 183 add_filter( 'wp_resource_hints', 'twentytwelve_resource_hints', 10, 2 ); 159 184 160 185 /**
Note: See TracChangeset
for help on using the changeset viewer.