- Timestamp:
- 10/23/2016 01:55:49 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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' ) ) :
Note: See TracChangeset
for help on using the changeset viewer.