diff options
Diffstat (limited to 'themes/twentysixteen/functions.php')
-rw-r--r-- | themes/twentysixteen/functions.php | 65 |
1 files changed, 43 insertions, 22 deletions
diff --git a/themes/twentysixteen/functions.php b/themes/twentysixteen/functions.php index 68e4a5ef..b5b7c207 100644 --- a/themes/twentysixteen/functions.php +++ b/themes/twentysixteen/functions.php @@ -11,14 +11,14 @@ * functions.php file. The child theme's functions.php file is included before * the parent theme's file, so the child theme functions would be used. * - * @link https://codex.wordpress.org/Theme_Development + * @link https://developer.wordpress.org/themes/basics/theme-functions/ * @link https://developer.wordpress.org/themes/advanced-topics/child-themes/ * * Functions that are not pluggable (not wrapped in function_exists()) are * instead attached to a filter or action hook. * * For more information on hooks, actions, and filters, - * {@link https://codex.wordpress.org/Plugin_API} + * {@link https://developer.wordpress.org/plugins/} * * @package WordPress * @subpackage Twenty_Sixteen @@ -106,13 +106,16 @@ if ( ! function_exists( 'twentysixteen_setup' ) ) : 'comment-list', 'gallery', 'caption', + 'script', + 'style', + 'navigation-widgets', ) ); /* * Enable support for Post Formats. * - * See: https://codex.wordpress.org/Post_Formats + * See: https://wordpress.org/support/article/post-formats/ */ add_theme_support( 'post-formats', @@ -213,8 +216,11 @@ if ( ! function_exists( 'twentysixteen_setup' ) ) : // Indicate widget sidebars can use selective refresh in the Customizer. add_theme_support( 'customize-selective-refresh-widgets' ); + + // Add support for custom line height controls. + add_theme_support( 'custom-line-height' ); } -endif; // twentysixteen_setup +endif; // twentysixteen_setup() add_action( 'after_setup_theme', 'twentysixteen_setup' ); /** @@ -236,9 +242,9 @@ add_action( 'after_setup_theme', 'twentysixteen_content_width', 0 ); * * @since Twenty Sixteen 1.6 * - * @param array $urls URLs to print for resource hints. - * @param string $relation_type The relation type the URLs are printed. - * @return array $urls URLs to print for resource hints. + * @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 twentysixteen_resource_hints( $urls, $relation_type ) { if ( wp_style_is( 'twentysixteen-fonts', 'queue' ) && 'preconnect' === $relation_type ) { @@ -313,17 +319,26 @@ if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : $fonts = array(); $subsets = 'latin,latin-ext'; - /* translators: If there are characters in your language that are not supported by Merriweather, translate this to 'off'. Do not translate into your own language. */ + /* + * translators: If there are characters in your language that are not supported + * by Merriweather, translate this to 'off'. Do not translate into your own language. + */ if ( 'off' !== _x( 'on', 'Merriweather font: on or off', 'twentysixteen' ) ) { $fonts[] = 'Merriweather:400,700,900,400italic,700italic,900italic'; } - /* translators: If there are characters in your language that are not supported by Montserrat, translate this to 'off'. Do not translate into your own language. */ + /* + * translators: If there are characters in your language that are not supported + * by Montserrat, translate this to 'off'. Do not translate into your own language. + */ if ( 'off' !== _x( 'on', 'Montserrat font: on or off', 'twentysixteen' ) ) { $fonts[] = 'Montserrat:400,700'; } - /* translators: If there are characters in your language that are not supported by Inconsolata, translate this to 'off'. Do not translate into your own language. */ + /* + * translators: If there are characters in your language that are not supported + * by Inconsolata, translate this to 'off'. Do not translate into your own language. + */ if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentysixteen' ) ) { $fonts[] = 'Inconsolata:400'; } @@ -331,8 +346,9 @@ if ( ! function_exists( 'twentysixteen_fonts_url' ) ) : if ( $fonts ) { $fonts_url = add_query_arg( array( - 'family' => urlencode( implode( '|', $fonts ) ), - 'subset' => urlencode( $subsets ), + 'family' => urlencode( implode( '|', $fonts ) ), + 'subset' => urlencode( $subsets ), + 'display' => urlencode( 'fallback' ), ), 'https://fonts.googleapis.com/css' ); @@ -364,41 +380,41 @@ function twentysixteen_scripts() { wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); // Add Genericons, used in the main stylesheet. - wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.4.1' ); + wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '20201208' ); // Theme stylesheet. - wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri() ); + wp_enqueue_style( 'twentysixteen-style', get_stylesheet_uri(), array(), '20201208' ); // Theme block stylesheet. - wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20181230' ); + wp_enqueue_style( 'twentysixteen-block-style', get_template_directory_uri() . '/css/blocks.css', array( 'twentysixteen-style' ), '20190102' ); // Load the Internet Explorer specific stylesheet. - wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20160816' ); + wp_enqueue_style( 'twentysixteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentysixteen-style' ), '20170530' ); wp_style_add_data( 'twentysixteen-ie', 'conditional', 'lt IE 10' ); // Load the Internet Explorer 8 specific stylesheet. - wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20160816' ); + wp_enqueue_style( 'twentysixteen-ie8', get_template_directory_uri() . '/css/ie8.css', array( 'twentysixteen-style' ), '20170530' ); wp_style_add_data( 'twentysixteen-ie8', 'conditional', 'lt IE 9' ); // Load the Internet Explorer 7 specific stylesheet. - wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20160816' ); + wp_enqueue_style( 'twentysixteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentysixteen-style' ), '20170530' ); wp_style_add_data( 'twentysixteen-ie7', 'conditional', 'lt IE 8' ); // Load the html5 shiv. wp_enqueue_script( 'twentysixteen-html5', get_template_directory_uri() . '/js/html5.js', array(), '3.7.3' ); wp_script_add_data( 'twentysixteen-html5', 'conditional', 'lt IE 9' ); - wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20160816', true ); + wp_enqueue_script( 'twentysixteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20170530', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { - wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20160816' ); + wp_enqueue_script( 'twentysixteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20170530' ); } - wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20181230', true ); + wp_enqueue_script( 'twentysixteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20181217', true ); wp_localize_script( 'twentysixteen-script', @@ -418,7 +434,7 @@ add_action( 'wp_enqueue_scripts', 'twentysixteen_scripts' ); */ function twentysixteen_block_editor_styles() { // Block styles. - wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20181230' ); + wp_enqueue_style( 'twentysixteen-block-editor-style', get_template_directory_uri() . '/css/editor-blocks.css', array(), '20201208' ); // Add custom fonts. wp_enqueue_style( 'twentysixteen-fonts', twentysixteen_fonts_url(), array(), null ); } @@ -494,6 +510,11 @@ function twentysixteen_hex2rgb( $color ) { require get_template_directory() . '/inc/template-tags.php'; /** + * Block Patterns. + */ +require get_template_directory() . '/inc/block-patterns.php'; + +/** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; |