diff options
-rw-r--r-- | themes/twentyfifteen/functions.php | 38 | ||||
-rw-r--r-- | themes/twentyfifteen/readme.txt | 9 | ||||
-rw-r--r-- | themes/twentyfifteen/style.css | 2 |
3 files changed, 46 insertions, 3 deletions
diff --git a/themes/twentyfifteen/functions.php b/themes/twentyfifteen/functions.php index 056a3613..8ae7e1da 100644 --- a/themes/twentyfifteen/functions.php +++ b/themes/twentyfifteen/functions.php @@ -118,6 +118,19 @@ function twentyfifteen_setup() { $default_color = trim( $color_scheme[0], '#' ); // Setup the WordPress core custom background feature. + + /** + * Filter Twenty Fifteen custom-header support arguments. + * + * @since Twenty Fifteen 1.0 + * + * @param array $args { + * An array of custom-header support arguments. + * + * @type string $default-color Default color of the header. + * @type string $default-attachment Default attachment of the header. + * } + */ add_theme_support( 'custom-background', apply_filters( 'twentyfifteen_custom_background_args', array( 'default-color' => $default_color, 'default-attachment' => 'fixed', @@ -273,6 +286,31 @@ function twentyfifteen_scripts() { add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' ); /** + * Add preconnect for Google Fonts. + * + * @since Twenty Fifteen 1.7 + * + * @param array $urls URLs to print for resource hints. + * @param string $relation_type The relation type the URLs are printed. + * @return array URLs to print for resource hints. + */ +function twentyfifteen_resource_hints( $urls, $relation_type ) { + if ( wp_style_is( 'twentyfifteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { + if ( version_compare( $GLOBALS['wp_version'], '4.7-alpha', '>=' ) ) { + $urls[] = array( + 'href' => 'https://fonts.gstatic.com', + 'crossorigin', + ); + } else { + $urls[] = 'https://fonts.gstatic.com'; + } + } + + return $urls; +} +add_filter( 'wp_resource_hints', 'twentyfifteen_resource_hints', 10, 2 ); + +/** * Add featured image as background image to post navigation elements. * * @since Twenty Fifteen 1.0 diff --git a/themes/twentyfifteen/readme.txt b/themes/twentyfifteen/readme.txt index 36ef9404..8ca82808 100644 --- a/themes/twentyfifteen/readme.txt +++ b/themes/twentyfifteen/readme.txt @@ -1,8 +1,8 @@ === Twenty Fifteen === Contributors: the WordPress team Requires at least: WordPress 4.1 -Tested up to: WordPress 4.7-trunk -Version: 1.6 +Tested up to: WordPress 4.8-trunk +Version: 1.7 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready @@ -55,6 +55,11 @@ Source: http://www.genericons.com == Changelog == += 1.7 = +* Released: December 6, 2016 + +https://codex.wordpress.org/Twenty_Fifteen_Theme_Changelog#Version_1.7 + = 1.6 = * Released: August 15, 2016 diff --git a/themes/twentyfifteen/style.css b/themes/twentyfifteen/style.css index 56e46b68..13048ba9 100644 --- a/themes/twentyfifteen/style.css +++ b/themes/twentyfifteen/style.css @@ -4,7 +4,7 @@ Theme URI: https://wordpress.org/themes/twentyfifteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer. -Version: 1.6 +Version: 1.7 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: blog, two-columns, left-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready |