diff --git src/wp-content/themes/twentyfifteen/functions.php src/wp-content/themes/twentyfifteen/functions.php
index 056a361..e5436f1 100644
|
|
|
function twentyfifteen_scripts() { |
| 273 | 273 | add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' ); |
| 274 | 274 | |
| 275 | 275 | /** |
| | 276 | * Add preconnect for Google Fonts. |
| | 277 | * |
| | 278 | * @since Twenty Fifteen 1.6 |
| | 279 | * |
| | 280 | * @param array $urls URLs to print for resource hints. |
| | 281 | * @param string $relation_type The relation type the URLs are printed. |
| | 282 | * @return array URLs to print for resource hints. |
| | 283 | */ |
| | 284 | function twentyfifteen_resource_hints( $urls, $relation_type ) { |
| | 285 | if ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { |
| | 286 | if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { |
| | 287 | $urls[] = array( |
| | 288 | 'href' => 'https://fonts.gstatic.com', |
| | 289 | 'crossorigin', |
| | 290 | ); |
| | 291 | } else { |
| | 292 | $urls[] = 'https://fonts.gstatic.com'; |
| | 293 | } |
| | 294 | } |
| | 295 | |
| | 296 | return $urls; |
| | 297 | } |
| | 298 | add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 ); |
| | 299 | |
| | 300 | /** |
| 276 | 301 | * Add featured image as background image to post navigation elements. |
| 277 | 302 | * |
| 278 | 303 | * @since Twenty Fifteen 1.0 |
diff --git src/wp-content/themes/twentyfourteen/functions.php src/wp-content/themes/twentyfourteen/functions.php
index f85ef1c..f4ea043 100644
|
|
|
function twentyfourteen_admin_fonts() { |
| 277 | 277 | } |
| 278 | 278 | add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfourteen_admin_fonts' ); |
| 279 | 279 | |
| | 280 | /** |
| | 281 | * Add preconnect for Google Fonts. |
| | 282 | * |
| | 283 | * @since Twenty Fourteen 1.8 |
| | 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 ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { |
| | 292 | if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { |
| | 293 | $urls[] = array( |
| | 294 | 'href' => 'https://fonts.gstatic.com', |
| | 295 | 'crossorigin', |
| | 296 | ); |
| | 297 | } else { |
| | 298 | $urls[] = 'https://fonts.gstatic.com'; |
| | 299 | } |
| | 300 | } |
| | 301 | } |
| | 302 | |
| | 303 | return $urls; |
| | 304 | } |
| | 305 | add_filter( 'wp_resource_hints', 'twentyfourteen_resource_hints', 10, 2 ); |
| | 306 | |
| 280 | 307 | if ( ! function_exists( 'twentyfourteen_the_attached_image' ) ) : |
| 281 | 308 | /** |
| 282 | 309 | * Print the attached image with a link to the next attached image. |
diff --git src/wp-content/themes/twentythirteen/functions.php src/wp-content/themes/twentythirteen/functions.php
index ae1bd9e..c9fe318 100644
|
|
|
function twentythirteen_scripts_styles() { |
| 191 | 191 | add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' ); |
| 192 | 192 | |
| 193 | 193 | /** |
| | 194 | * Add preconnect for Google Fonts. |
| | 195 | * |
| | 196 | * @since Twenty Thirteen 2.0 |
| | 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 ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { |
| | 205 | if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { |
| | 206 | $urls[] = array( |
| | 207 | 'href' => 'https://fonts.gstatic.com', |
| | 208 | 'crossorigin', |
| | 209 | ); |
| | 210 | } else { |
| | 211 | $urls[] = 'https://fonts.gstatic.com'; |
| | 212 | } |
| | 213 | } |
| | 214 | } |
| | 215 | |
| | 216 | return $urls; |
| | 217 | } |
| | 218 | add_filter( 'wp_resource_hints', 'twentythirteen_resource_hints', 10, 2 ); |
| | 219 | |
| | 220 | /** |
| 194 | 221 | * Filter the page title. |
| 195 | 222 | * |
| 196 | 223 | * Creates a nicely formatted and more specific title element text for output |
diff --git src/wp-content/themes/twentytwelve/functions.php src/wp-content/themes/twentytwelve/functions.php
index 56cd8e5..d66e484 100644
|
|
|
function twentytwelve_scripts_styles() { |
| 158 | 158 | add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' ); |
| 159 | 159 | |
| 160 | 160 | /** |
| | 161 | * Add preconnect for Google Fonts. |
| | 162 | * |
| | 163 | * @since Twenty Twelve 2.1 |
| | 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 ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { |
| | 172 | if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { |
| | 173 | $urls[] = array( |
| | 174 | 'href' => 'https://fonts.gstatic.com', |
| | 175 | 'crossorigin', |
| | 176 | ); |
| | 177 | } else { |
| | 178 | $urls[] = 'https://fonts.gstatic.com'; |
| | 179 | } |
| | 180 | } |
| | 181 | } |
| | 182 | |
| | 183 | return $urls; |
| | 184 | } |
| | 185 | add_filter( 'wp_resource_hints', 'twentytwelve_resource_hints', 10, 2 ); |
| | 186 | |
| | 187 | /** |
| 161 | 188 | * Filter TinyMCE CSS path to include Google Fonts. |
| 162 | 189 | * |
| 163 | 190 | * Adds additional stylesheets to the TinyMCE editor if needed. |