Changeset 38870 for trunk/src/wp-content/themes/twentyfifteen/functions.php
- Timestamp:
- 10/23/2016 01:55:49 AM (8 years ago)
- File:
-
- 1 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 *
Note: See TracChangeset
for help on using the changeset viewer.