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