From 856daf897233b153771276d227f05f8f33a6189e Mon Sep 17 00:00:00 2001 From: Yury German Date: Sun, 23 Jan 2022 19:12:12 -0500 Subject: twentyfourteen upg 2.7 to 3.2 and twentysixteen from 2.0 to 2.5 Signed-off-by: Yury German --- themes/twentyfourteen/archive.php | 31 ++-- themes/twentyfourteen/author.php | 13 +- themes/twentyfourteen/category.php | 13 +- themes/twentyfourteen/comments.php | 4 +- themes/twentyfourteen/content-aside.php | 4 +- themes/twentyfourteen/content-audio.php | 4 +- themes/twentyfourteen/content-featured-post.php | 6 +- themes/twentyfourteen/content-gallery.php | 4 +- themes/twentyfourteen/content-image.php | 4 +- themes/twentyfourteen/content-link.php | 4 +- themes/twentyfourteen/content-none.php | 7 +- themes/twentyfourteen/content-quote.php | 4 +- themes/twentyfourteen/content-video.php | 4 +- themes/twentyfourteen/content.php | 6 +- themes/twentyfourteen/css/blocks.css | 13 ++ themes/twentyfourteen/css/editor-blocks.css | 95 +++++++++++-- themes/twentyfourteen/css/editor-style.css | 1 - themes/twentyfourteen/footer.php | 5 +- themes/twentyfourteen/functions.php | 66 ++++++--- themes/twentyfourteen/header.php | 4 +- themes/twentyfourteen/image.php | 4 +- themes/twentyfourteen/images/bridge.jpg | Bin 0 -> 138675 bytes themes/twentyfourteen/images/clouds.jpg | Bin 0 -> 93526 bytes themes/twentyfourteen/images/pattern-dark.svg | 32 ++--- themes/twentyfourteen/images/pattern-light.svg | 12 +- themes/twentyfourteen/images/person.jpg | Bin 0 -> 155463 bytes themes/twentyfourteen/images/street.jpg | Bin 0 -> 177017 bytes themes/twentyfourteen/images/sunset.jpg | Bin 0 -> 114946 bytes themes/twentyfourteen/inc/back-compat.php | 24 +++- themes/twentyfourteen/inc/block-patterns.php | 73 ++++++++++ themes/twentyfourteen/inc/custom-header.php | 46 +++--- themes/twentyfourteen/inc/customizer.php | 10 +- themes/twentyfourteen/inc/featured-content.php | 17 +-- themes/twentyfourteen/inc/template-tags.php | 21 +-- themes/twentyfourteen/inc/widgets.php | 29 ++-- themes/twentyfourteen/index.php | 4 +- themes/twentyfourteen/js/functions.js | 7 +- .../twentyfourteen/page-templates/contributors.php | 2 +- .../twentyfourteen/page-templates/full-width.php | 2 +- themes/twentyfourteen/page.php | 2 +- themes/twentyfourteen/readme.txt | 42 +++++- themes/twentyfourteen/rtl.css | 7 + themes/twentyfourteen/search.php | 13 +- themes/twentyfourteen/single.php | 6 +- themes/twentyfourteen/style.css | 104 ++++++++++++-- themes/twentyfourteen/tag.php | 13 +- themes/twentyfourteen/taxonomy-post_format.php | 6 +- themes/twentysixteen/archive.php | 5 +- themes/twentysixteen/comments.php | 4 +- themes/twentysixteen/css/blocks.css | 35 +++-- themes/twentysixteen/css/editor-blocks.css | 147 +++++++++++++++---- themes/twentysixteen/css/editor-style.css | 8 +- themes/twentysixteen/footer.php | 5 +- themes/twentysixteen/functions.php | 65 ++++++--- themes/twentysixteen/genericons/genericons.css | 2 +- themes/twentysixteen/header.php | 4 +- themes/twentysixteen/image.php | 6 +- themes/twentysixteen/inc/back-compat.php | 24 +++- themes/twentysixteen/inc/block-patterns.php | 157 +++++++++++++++++++++ themes/twentysixteen/inc/customizer.php | 70 ++++----- themes/twentysixteen/inc/template-tags.php | 16 ++- themes/twentysixteen/index.php | 3 +- themes/twentysixteen/js/functions.js | 2 +- themes/twentysixteen/page.php | 2 +- themes/twentysixteen/readme.txt | 39 +++-- themes/twentysixteen/rtl.css | 2 +- themes/twentysixteen/search.php | 7 +- themes/twentysixteen/single.php | 2 +- themes/twentysixteen/style.css | 31 +++- themes/twentysixteen/template-parts/biography.php | 7 +- .../twentysixteen/template-parts/content-none.php | 7 +- .../twentysixteen/template-parts/content-page.php | 2 +- .../template-parts/content-search.php | 4 +- .../template-parts/content-single.php | 2 +- themes/twentysixteen/template-parts/content.php | 4 +- 75 files changed, 1079 insertions(+), 351 deletions(-) create mode 100644 themes/twentyfourteen/images/bridge.jpg create mode 100644 themes/twentyfourteen/images/clouds.jpg create mode 100644 themes/twentyfourteen/images/person.jpg create mode 100644 themes/twentyfourteen/images/street.jpg create mode 100644 themes/twentyfourteen/images/sunset.jpg create mode 100644 themes/twentyfourteen/inc/block-patterns.php create mode 100644 themes/twentysixteen/inc/block-patterns.php diff --git a/themes/twentyfourteen/archive.php b/themes/twentyfourteen/archive.php index 9d2ba95f..f11a57ff 100644 --- a/themes/twentyfourteen/archive.php +++ b/themes/twentyfourteen/archive.php @@ -27,31 +27,30 @@ get_header(); ?> */ the_post(); + /* translators: %s: Author display name. */ printf( __( 'All posts by %s', 'twentyfourteen' ), get_the_author() ); ?> @@ -38,19 +39,19 @@ get_header(); ?>
-

+

+ +

- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content-audio.php b/themes/twentyfourteen/content-audio.php index 36aa5a9d..4ae2dbc1 100644 --- a/themes/twentyfourteen/content-audio.php +++ b/themes/twentyfourteen/content-audio.php @@ -12,7 +12,7 @@
- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content-featured-post.php b/themes/twentyfourteen/content-featured-post.php index 707b9570..803451fc 100644 --- a/themes/twentyfourteen/content-featured-post.php +++ b/themes/twentyfourteen/content-featured-post.php @@ -11,9 +11,9 @@
>
- + diff --git a/themes/twentyfourteen/content-gallery.php b/themes/twentyfourteen/content-gallery.php index 2f793a8e..1d04b85d 100644 --- a/themes/twentyfourteen/content-gallery.php +++ b/themes/twentyfourteen/content-gallery.php @@ -12,7 +12,7 @@
- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content-image.php b/themes/twentyfourteen/content-image.php index 5e58bf00..27985af9 100644 --- a/themes/twentyfourteen/content-image.php +++ b/themes/twentyfourteen/content-image.php @@ -12,7 +12,7 @@
- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content-link.php b/themes/twentyfourteen/content-link.php index d4c7c8bd..df30b8d2 100644 --- a/themes/twentyfourteen/content-link.php +++ b/themes/twentyfourteen/content-link.php @@ -12,7 +12,7 @@
- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content-none.php b/themes/twentyfourteen/content-none.php index a97f84c8..7e35a720 100644 --- a/themes/twentyfourteen/content-none.php +++ b/themes/twentyfourteen/content-none.php @@ -15,7 +15,12 @@
-

Get started here.', 'twentyfourteen' ), admin_url( 'post-new.php' ) ); ?>

+

+ Get started here.', 'twentyfourteen' ), admin_url( 'post-new.php' ) ); + ?> +

diff --git a/themes/twentyfourteen/content-quote.php b/themes/twentyfourteen/content-quote.php index 29e6ec37..9726792c 100644 --- a/themes/twentyfourteen/content-quote.php +++ b/themes/twentyfourteen/content-quote.php @@ -12,7 +12,7 @@
- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content-video.php b/themes/twentyfourteen/content-video.php index 1c1a0efb..814061ce 100644 --- a/themes/twentyfourteen/content-video.php +++ b/themes/twentyfourteen/content-video.php @@ -12,7 +12,7 @@
- + @@ -43,9 +43,9 @@
→', 'twentyfourteen' ), the_title( '', '', false ) ) diff --git a/themes/twentyfourteen/content.php b/themes/twentyfourteen/content.php index bf053633..1c480433 100644 --- a/themes/twentyfourteen/content.php +++ b/themes/twentyfourteen/content.php @@ -14,7 +14,7 @@
- + @@ -30,7 +30,7 @@
@@ -538,7 +556,7 @@ function twentyfourteen_body_classes( $classes ) { if ( get_header_image() ) { $classes[] = 'header-image'; - } elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ) ) ) { + } elseif ( ! in_array( $GLOBALS['pagenow'], array( 'wp-activate.php', 'wp-signup.php' ), true ) ) { $classes[] = 'masthead-fixed'; } @@ -561,7 +579,7 @@ function twentyfourteen_body_classes( $classes ) { $classes[] = 'singular'; } - if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { + if ( is_front_page() && 'slider' === get_theme_mod( 'featured_content_layout' ) ) { $classes[] = 'slider'; } elseif ( is_front_page() ) { $classes[] = 'grid'; @@ -622,6 +640,7 @@ function twentyfourteen_wp_title( $title, $sep ) { // Add a page number if necessary. if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { + /* translators: %s: Page number. */ $title = "$title $sep " . sprintf( __( 'Page %s', 'twentyfourteen' ), max( $paged, $page ) ); } @@ -659,6 +678,9 @@ require get_template_directory() . '/inc/template-tags.php'; // Add Customizer functionality. require get_template_directory() . '/inc/customizer.php'; +// Add support for block patterns. +require get_template_directory() . '/inc/block-patterns.php'; + /* * Add Featured Content functionality. * diff --git a/themes/twentyfourteen/header.php b/themes/twentyfourteen/header.php index 88071ec9..4bedca64 100644 --- a/themes/twentyfourteen/header.php +++ b/themes/twentyfourteen/header.php @@ -22,10 +22,10 @@ <?php wp_title( '|', true, 'right' ); ?> - + diff --git a/themes/twentyfourteen/image.php b/themes/twentyfourteen/image.php index eb4a1658..ed5a9f2e 100644 --- a/themes/twentyfourteen/image.php +++ b/themes/twentyfourteen/image.php @@ -17,7 +17,7 @@ get_header();
@@ -72,7 +72,7 @@ get_header(); - +
diff --git a/themes/twentyfourteen/images/bridge.jpg b/themes/twentyfourteen/images/bridge.jpg new file mode 100644 index 00000000..d172bb28 Binary files /dev/null and b/themes/twentyfourteen/images/bridge.jpg differ diff --git a/themes/twentyfourteen/images/clouds.jpg b/themes/twentyfourteen/images/clouds.jpg new file mode 100644 index 00000000..f753465d Binary files /dev/null and b/themes/twentyfourteen/images/clouds.jpg differ diff --git a/themes/twentyfourteen/images/pattern-dark.svg b/themes/twentyfourteen/images/pattern-dark.svg index ef6d5d83..af4bc9a4 100644 --- a/themes/twentyfourteen/images/pattern-dark.svg +++ b/themes/twentyfourteen/images/pattern-dark.svg @@ -1,16 +1,16 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/themes/twentyfourteen/images/pattern-light.svg b/themes/twentyfourteen/images/pattern-light.svg index 55a48f1b..a8a3be32 100644 --- a/themes/twentyfourteen/images/pattern-light.svg +++ b/themes/twentyfourteen/images/pattern-light.svg @@ -1,6 +1,6 @@ - - - + + + diff --git a/themes/twentyfourteen/images/person.jpg b/themes/twentyfourteen/images/person.jpg new file mode 100644 index 00000000..8dbad508 Binary files /dev/null and b/themes/twentyfourteen/images/person.jpg differ diff --git a/themes/twentyfourteen/images/street.jpg b/themes/twentyfourteen/images/street.jpg new file mode 100644 index 00000000..71735a04 Binary files /dev/null and b/themes/twentyfourteen/images/street.jpg differ diff --git a/themes/twentyfourteen/images/sunset.jpg b/themes/twentyfourteen/images/sunset.jpg new file mode 100644 index 00000000..8c1b379f Binary files /dev/null and b/themes/twentyfourteen/images/sunset.jpg differ diff --git a/themes/twentyfourteen/inc/back-compat.php b/themes/twentyfourteen/inc/back-compat.php index 0e8f34b5..a0e0b118 100644 --- a/themes/twentyfourteen/inc/back-compat.php +++ b/themes/twentyfourteen/inc/back-compat.php @@ -34,8 +34,14 @@ add_action( 'after_switch_theme', 'twentyfourteen_switch_theme' ); * @since Twenty Fourteen 1.0 */ function twentyfourteen_upgrade_notice() { - $message = sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -45,7 +51,11 @@ function twentyfourteen_upgrade_notice() { */ function twentyfourteen_customize() { wp_die( - sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ), + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), + $GLOBALS['wp_version'] + ), '', array( 'back_link' => true, @@ -61,7 +71,13 @@ add_action( 'load-customize.php', 'twentyfourteen_customize' ); */ function twentyfourteen_preview() { if ( isset( $_GET['preview'] ) ) { - wp_die( sprintf( __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), $GLOBALS['wp_version'] ) ); + wp_die( + sprintf( + /* translators: %s: WordPress version. */ + __( 'Twenty Fourteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentyfourteen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentyfourteen_preview' ); diff --git a/themes/twentyfourteen/inc/block-patterns.php b/themes/twentyfourteen/inc/block-patterns.php new file mode 100644 index 00000000..5d653007 --- /dev/null +++ b/themes/twentyfourteen/inc/block-patterns.php @@ -0,0 +1,73 @@ + esc_html__( 'Twenty Fourteen', 'twentyfourteen' ) ) + ); +} + +/** + * Register Block Patterns. + */ +if ( function_exists( 'register_block_pattern' ) ) { + + // Description + register_block_pattern( + 'twentyfourteen/about', + array( + 'title' => esc_html__( 'About', 'twentyfourteen' ), + 'categories' => array( 'twentyfourteen' ), + 'viewportWidth' => 1000, + 'content' => '
' . esc_attr__( 'A person standing in front of a lake', 'twentyfourteen' ) . '

' . esc_html__( 'Hello, my name is Joan. I am passionate about writing, travel, and photography.', 'twentyfourteen' ) . '

' . esc_html__( 'I’ve traveled to over 60 countries, and have made many friends along the way. I created this website to keep track of the memories I’ve made in my years of traveling.', 'twentyfourteen' ) . '

', + ) + ); + + // Description + register_block_pattern( + 'twentyfourteen/list', + array( + 'title' => esc_html__( 'List', 'twentyfourteen' ), + 'categories' => array( 'twentyfourteen' ), + 'viewportWidth' => 1000, + 'content' => '

' . esc_html__( '2001', 'twentyfourteen' ) . '

' . esc_html__( 'My first year of traveling. I visited China, Thailand, Japan, and India.', 'twentyfourteen' ) . '


' . esc_html__( '2012', 'twentyfourteen' ) . '

' . esc_html__( 'In 2012, I expanded my travels to Europe. I spent time in Poland, Germany, Italy, France, and Spain. ', 'twentyfourteen' ) . '


' . esc_html__( '2016', 'twentyfourteen' ) . '

' . esc_html__( 'This year was devoted entirely to the western hemisphere. I went on a month-long road trip through the U.S.A. and Canada, and also visited Mexico, Brazil, and Colombia.', 'twentyfourteen' ) . '

', + ) + ); + + // Heading and paragraph with four images. + register_block_pattern( + 'twentyfourteen/summary', + array( + 'title' => esc_html__( 'Summary', 'twentyfourteen' ), + 'categories' => array( 'twentyfourteen' ), + 'viewportWidth' => 1000, + 'content' => '

' . esc_html__( 'Traveling Nostalgia', 'twentyfourteen' ) . '

' . esc_html__( 'Here are some photos from my all-time favorite destinations.', 'twentyfourteen' ) . '

' . esc_html__( 'Photo of a sunset', 'twentyfourteen' ) . '
' . esc_html__( 'Sunset', 'twentyfourteen' ) . '
' . esc_attr__( 'Photo of a bridge', 'twentyfourteen' ) . '
' . esc_html__( 'Bridge', 'twentyfourteen' ) . '
' . esc_attr__( 'Photo of a streetscape', 'twentyfourteen' ) . '
' . esc_html__( 'Streetscape', 'twentyfourteen' ) . '
' . esc_attr__( 'Photo of a cloudy mountain', 'twentyfourteen' ) . '
' . esc_html__( 'Clouds', 'twentyfourteen' ) . '
', + ) + ); + + // Cover block with contact message. + register_block_pattern( + 'twentyfourteen/contact', + array( + 'title' => esc_html__( 'Contact', 'twentyfourteen' ), + 'categories' => array( 'twentyfourteen' ), + 'viewportWidth' => 1000, + 'content' => '

' . esc_html__( 'GOT A QUESTION?', 'twentyfourteen' ) . '

' . esc_html__( 'Don’t hesitate to reach out.', 'twentyfourteen' ) . '

', + ) + ); + +} diff --git a/themes/twentyfourteen/inc/custom-header.php b/themes/twentyfourteen/inc/custom-header.php index 92382eaa..7fb590db 100644 --- a/themes/twentyfourteen/inc/custom-header.php +++ b/themes/twentyfourteen/inc/custom-header.php @@ -17,26 +17,26 @@ * @uses twentyfourteen_admin_header_image() */ function twentyfourteen_custom_header_setup() { - /** - * Filter Twenty Fourteen custom-header support arguments. - * - * @since Twenty Fourteen 1.0 - * - * @param array $args { - * An array of custom-header support arguments. - * - * @type bool $header_text Whether to display custom header text. Default false. - * @type int $width Width in pixels of the custom header image. Default 1260. - * @type int $height Height in pixels of the custom header image. Default 240. - * @type bool $flex_height Whether to allow flexible-height header images. Default true. - * @type string $admin_head_callback Callback function used to style the image displayed in - * the Appearance > Header screen. - * @type string $admin_preview_callback Callback function used to create the custom header markup in - * the Appearance > Header screen. - * } - */ add_theme_support( 'custom-header', + /** + * Filters Twenty Fourteen custom-header support arguments. + * + * @since Twenty Fourteen 1.0 + * + * @param array $args { + * An array of custom-header support arguments. + * + * @type bool $header_text Whether to display custom header text. Default false. + * @type int $width Width in pixels of the custom header image. Default 1260. + * @type int $height Height in pixels of the custom header image. Default 240. + * @type bool $flex_height Whether to allow flexible-height header images. Default true. + * @type string $admin_head_callback Callback function used to style the image displayed in + * the Appearance > Header screen. + * @type string $admin_preview_callback Callback function used to create the custom header markup in + * the Appearance > Header screen. + * } + */ apply_filters( 'twentyfourteen_custom_header_args', array( @@ -63,7 +63,7 @@ if ( ! function_exists( 'twentyfourteen_header_style' ) ) : $text_color = get_header_textcolor(); // If no custom color for text is set, let's bail. - if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) { + if ( display_header_text() && get_theme_support( 'custom-header', 'default-text-color' ) === $text_color ) { return; } @@ -82,7 +82,7 @@ if ( ! function_exists( 'twentyfourteen_header_style' ) ) : } .site-title a { color: #; @@ -91,7 +91,7 @@ if ( ! function_exists( 'twentyfourteen_header_style' ) ) : __( 'Featured Content', 'twentyfourteen' ), 'description' => sprintf( + /* translators: 1: Featured tag editor URL, 2: Post editor URL. */ __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'edit.php?show_sticky=1' ) @@ -97,6 +98,7 @@ add_action( 'customize_register', 'twentyfourteen_customize_register' ); * Render the site title for the selective refresh partial. * * @since Twenty Fourteen 1.7 + * * @see twentyfourteen_customize_register() * * @return void @@ -109,6 +111,7 @@ function twentyfourteen_customize_partial_blogname() { * Render the site tagline for the selective refresh partial. * * @since Twenty Fourteen 1.7 + * * @see twentyfourteen_customize_register() * * @return void @@ -126,7 +129,7 @@ function twentyfourteen_customize_partial_blogdescription() { * @return string Filtered layout type (grid|slider). */ function twentyfourteen_sanitize_layout( $layout ) { - if ( ! in_array( $layout, array( 'grid', 'slider' ) ) ) { + if ( ! in_array( $layout, array( 'grid', 'slider' ), true ) ) { $layout = 'grid'; } @@ -139,7 +142,7 @@ function twentyfourteen_sanitize_layout( $layout ) { * @since Twenty Fourteen 1.0 */ function twentyfourteen_customize_preview_js() { - wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20131205', true ); + wp_enqueue_script( 'twentyfourteen_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20141015', true ); } add_action( 'customize_preview_init', 'twentyfourteen_customize_preview_js' ); @@ -159,8 +162,11 @@ function twentyfourteen_contextual_help() { 'title' => __( 'Twenty Fourteen', 'twentyfourteen' ), 'content' => '
    ' . + /* translators: 1: Featured tag editor URL, 2: Post editor URL, 3: Customizer URL, 4: Post editor URL. */ '
  • ' . sprintf( __( 'The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a tag; you can change the tag and layout in Appearance → Customize. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'customize.php' ), admin_url( 'edit.php?show_sticky=1' ) ) . '
  • ' . + /* translators: %s: Featured images documentation URL. */ '
  • ' . sprintf( __( 'Enhance your site design by using Featured Images for posts you’d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages—above the title—and in the Featured Content area on the home page.', 'twentyfourteen' ), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail' ) . '
  • ' . + /* translators: %s: Twenty Fourteen documentation URL. */ '
  • ' . sprintf( __( 'For an in-depth tutorial, and more tips and tricks, visit the Twenty Fourteen documentation.', 'twentyfourteen' ), 'https://codex.wordpress.org/Twenty_Fourteen' ) . '
  • ' . '
', ) diff --git a/themes/twentyfourteen/inc/featured-content.php b/themes/twentyfourteen/inc/featured-content.php index 23fb38d7..da8b76f7 100644 --- a/themes/twentyfourteen/inc/featured-content.php +++ b/themes/twentyfourteen/inc/featured-content.php @@ -190,7 +190,7 @@ class Featured_Content { } /** - * Delete featured content ids transient. + * Delete featured content IDs transient. * * Hooks in the "save_post" action. * @@ -233,7 +233,7 @@ class Featured_Content { return; } - // We need to respect post ids already in the blacklist. + // We need to respect post IDs already in the exclude list. $post__not_in = $query->get( 'post__not_in' ); if ( ! empty( $post__not_in ) ) { @@ -292,7 +292,7 @@ class Featured_Content { } // We only want to hide the featured tag. - if ( ! in_array( 'post_tag', $taxonomies ) ) { + if ( ! in_array( 'post_tag', $taxonomies, true ) ) { return $terms; } @@ -302,7 +302,7 @@ class Featured_Content { } // Bail if term objects are unavailable. - if ( 'all' != $args['fields'] ) { + if ( 'all' !== $args['fields'] ) { return $terms; } @@ -339,7 +339,7 @@ class Featured_Content { } // Make sure we are in the correct taxonomy. - if ( 'post_tag' != $taxonomy ) { + if ( 'post_tag' !== $taxonomy ) { return $terms; } @@ -380,6 +380,7 @@ class Featured_Content { array( 'title' => __( 'Featured Content', 'twentyfourteen' ), 'description' => sprintf( + /* translators: 1: Featured tag editor URL, 2: Post editor URL. */ __( 'Use a tag to feature your posts. If no posts match the tag, sticky posts will be displayed instead.', 'twentyfourteen' ), esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ), admin_url( 'edit.php?show_sticky=1' ) @@ -433,7 +434,7 @@ class Featured_Content { * @since Twenty Fourteen 1.0 */ public static function enqueue_scripts() { - wp_enqueue_script( 'featured-content-suggest', get_template_directory_uri() . '/js/featured-content-admin.js', array( 'jquery', 'suggest' ), '20131022', true ); + wp_enqueue_script( 'featured-content-suggest', get_template_directory_uri() . '/js/featured-content-admin.js', array( 'jquery', 'suggest' ), '20131205', true ); } /** @@ -465,7 +466,7 @@ class Featured_Content { $options = wp_parse_args( $saved, $defaults ); $options = array_intersect_key( $options, $defaults ); - if ( 'all' != $key ) { + if ( 'all' !== $key ) { return isset( $options[ $key ] ) ? $options[ $key ] : false; } @@ -507,7 +508,7 @@ class Featured_Content { $output['hide-tag'] = isset( $input['hide-tag'] ) && $input['hide-tag'] ? 1 : 0; - // Delete the featured post ids transient. + // Delete the featured post IDs transient. self::delete_transient(); return $output; diff --git a/themes/twentyfourteen/inc/template-tags.php b/themes/twentyfourteen/inc/template-tags.php index f1e95294..09e7fbc6 100644 --- a/themes/twentyfourteen/inc/template-tags.php +++ b/themes/twentyfourteen/inc/template-tags.php @@ -24,7 +24,7 @@ if ( ! function_exists( 'twentyfourteen_paging_nav' ) ) : return; } - $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; + $paged = get_query_var( 'paged' ) ? (int) get_query_var( 'paged' ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); @@ -128,28 +128,29 @@ endif; * * @since Twenty Fourteen 1.0 * - * @return boolean true if blog has more than 1 category + * @return bool true if blog has more than 1 category */ function twentyfourteen_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ) ) ) { - // Create an array of all the categories that are attached to posts + $all_the_cool_cats = get_transient( 'twentyfourteen_category_count' ); + if ( false === $all_the_cool_cats ) { + // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'hide_empty' => 1, ) ); - // Count the number of categories that are attached to the posts + // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'twentyfourteen_category_count', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 || is_preview() ) { - // This blog has more than 1 category so twentyfourteen_categorized_blog should return true + // This blog has more than 1 category so twentyfourteen_categorized_blog() should return true. return true; } else { - // This blog has only 1 category so twentyfourteen_categorized_blog should return false + // This blog has only 1 category so twentyfourteen_categorized_blog() should return false. return false; } } @@ -207,7 +208,7 @@ if ( ! function_exists( 'twentyfourteen_post_thumbnail' ) ) : %2$s', esc_url( get_permalink( get_the_ID() ) ), - /* translators: %s: Name of current post */ + /* translators: %s: Post title. */ sprintf( __( 'Continue reading %s ', 'twentyfourteen' ), '' . get_the_title( get_the_ID() ) . '' ) ); return ' … ' . $link; @@ -237,7 +238,7 @@ if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * - * Added for backwards compatibility to support pre 5.2.0 WordPress versions. + * Added for backward compatibility to support pre-5.2.0 WordPress versions. * * @since Twenty Fourteen 2.7 */ diff --git a/themes/twentyfourteen/inc/widgets.php b/themes/twentyfourteen/inc/widgets.php index 0b99fe2a..d8d15c2b 100644 --- a/themes/twentyfourteen/inc/widgets.php +++ b/themes/twentyfourteen/inc/widgets.php @@ -4,7 +4,7 @@ * * Displays posts from Aside, Quote, Video, Audio, Image, Gallery, and Link formats. * - * @link https://codex.wordpress.org/Widgets_API#Developing_Widgets + * @link https://developer.wordpress.org/themes/functionality/widgets/#developing-widgets * * @package WordPress * @subpackage Twenty_Fourteen @@ -71,7 +71,11 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { * @param array $instance An array of settings for this widget instance. */ public function widget( $args, $instance ) { - $format = isset( $instance['format'] ) && in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside'; + $format = isset( $instance['format'] ) ? $instance['format'] : ''; + + if ( ! $format || ! in_array( $format, $this->formats, true ) ) { + $format = 'aside'; + } switch ( $format ) { case 'image': @@ -105,8 +109,9 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { break; } - $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); - $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? $format_string : $instance['title'], $instance, $this->id_base ); + $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2; + $title = ! empty( $instance['title'] ) ? $instance['title'] : $format_string; + $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $ephemera = new WP_Query( array( @@ -189,6 +194,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget {

%2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'twentyfourteen' ), esc_url( get_permalink() ), number_format_i18n( $total_images ) @@ -233,7 +239,7 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { →', 'twentyfourteen' ), $format_string_more ); ?> @@ -264,7 +270,8 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { function update( $new_instance, $instance ) { $instance['title'] = strip_tags( $new_instance['title'] ); $instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); - if ( in_array( $new_instance['format'], $this->formats ) ) { + + if ( in_array( $new_instance['format'], $this->formats, true ) ) { $instance['format'] = $new_instance['format']; } @@ -279,9 +286,13 @@ class Twenty_Fourteen_Ephemera_Widget extends WP_Widget { * @param array $instance */ function form( $instance ) { - $title = empty( $instance['title'] ) ? '' : esc_attr( $instance['title'] ); - $number = empty( $instance['number'] ) ? 2 : absint( $instance['number'] ); - $format = isset( $instance['format'] ) && in_array( $instance['format'], $this->formats ) ? $instance['format'] : 'aside'; + $title = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; + $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2; + $format = isset( $instance['format'] ) ? $instance['format'] : ''; + + if ( ! $format || ! in_array( $format, $this->formats, true ) ) { + $format = 'aside'; + } ?>

diff --git a/themes/twentyfourteen/index.php b/themes/twentyfourteen/index.php index 7f6d04a0..5ed4c35a 100644 --- a/themes/twentyfourteen/index.php +++ b/themes/twentyfourteen/index.php @@ -35,8 +35,8 @@ if ( is_front_page() && twentyfourteen_has_featured_posts() ) { the_post(); /* - * Include the post format-specific template for the content. If you want to - * use this in a child theme, then include a file called content-___.php + * Include the post format-specific template for the content. If you want + * to use this in a child theme, then include a file called content-___.php * (where ___ is the post format) and that will be used instead. */ get_template_part( 'content', get_post_format() ); diff --git a/themes/twentyfourteen/js/functions.js b/themes/twentyfourteen/js/functions.js index ac4629d7..557cc9f8 100644 --- a/themes/twentyfourteen/js/functions.js +++ b/themes/twentyfourteen/js/functions.js @@ -1,5 +1,5 @@ /** - * Theme functions file + * Theme functions file. * * Contains handlers for navigation, accessibility, header sizing * footer widgets and Featured Content slider @@ -126,6 +126,7 @@ * * Uses jQuery's width() function to determine the size of the window and add * the default ARIA attributes for the menu toggle if it's visible. + * * @since Twenty Fourteen 1.4 */ function onResizeARIA() { @@ -146,12 +147,12 @@ onResizeARIA(); } ); - _window.load( function() { + _window.on( 'load', function() { var footerSidebar, isCustomizeSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ); // Arrange footer widgets vertically. - if ( $.isFunction( $.fn.masonry ) ) { + if ( typeof $.fn.masonry === 'function' ) { footerSidebar = $( '#footer-sidebar' ); footerSidebar.masonry( { itemSelector: '.widget', diff --git a/themes/twentyfourteen/page-templates/contributors.php b/themes/twentyfourteen/page-templates/contributors.php index 635a259c..7756149e 100644 --- a/themes/twentyfourteen/page-templates/contributors.php +++ b/themes/twentyfourteen/page-templates/contributors.php @@ -21,7 +21,7 @@ if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
diff --git a/themes/twentyfourteen/page-templates/full-width.php b/themes/twentyfourteen/page-templates/full-width.php index ea5fa588..b75ac888 100644 --- a/themes/twentyfourteen/page-templates/full-width.php +++ b/themes/twentyfourteen/page-templates/full-width.php @@ -21,7 +21,7 @@ if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
-

+

+ +

.editor-rich-text p { - color: #686868; font-size: 19px; font-size: 1.1875rem; } @@ -536,6 +527,12 @@ Description: Used to style blocks in the editor. text-align: right; } +/* Verse */ + +.editor-styles-wrapper .wp-block-verse { + font-family: inherit; +} + /*-------------------------------------------------------------- 5.0 Blocks - Layout Elements --------------------------------------------------------------*/ @@ -615,3 +612,103 @@ Description: Used to style blocks in the editor. .edit-post-visual-editor .wp-block-latest-posts.is-grid li { margin-bottom: 16px; } + +/*-------------------------------------------------------------- +7.0 Blocks - Colors +--------------------------------------------------------------*/ + +:root .editor-styles-wrapper .has-dark-gray-color { + color: #1a1a1a; +} + +:root .editor-styles-wrapper .has-dark-gray-background-color { + background-color: #1a1a1a; +} + +:root .editor-styles-wrapper .has-medium-gray-color { + color: #686868; +} + +:root .editor-styles-wrapper .has-medium-gray-background-color { + background-color: #686868; +} + +:root .editor-styles-wrapper .has-light-gray-color { + color: #e5e5e5; +} + +:root .editor-styles-wrapper .has-light-gray-background-color { + background-color: #e5e5e5; +} + +:root .editor-styles-wrapper .has-white-color { + color: #fff; +} + +:root .editor-styles-wrapper .has-white-background-color { + background-color: #fff; +} + +:root .editor-styles-wrapper .has-blue-gray-color { + color: #4d545c; +} + +:root .editor-styles-wrapper .has-blue-gray-background-color { + background-color: #4d545c; +} + +:root .editor-styles-wrapper .has-bright-blue-color { + color: #007acc; +} + +:root .editor-styles-wrapper .has-bright-blue-background-color { + background-color: #007acc; +} + +:root .editor-styles-wrapper .has-light-blue-color { + color: #9adffd; +} + +:root .editor-styles-wrapper .has-light-blue-background-color { + background-color: #9adffd; +} + +:root .editor-styles-wrapper .has-dark-brown-color { + color: #402b30; +} + +:root .editor-styles-wrapper .has-dark-brown-background-color { + background-color: #402b30; +} + +:root .editor-styles-wrapper .has-medium-brown-color { + color: #774e24; +} + +:root .editor-styles-wrapper .has-medium-brown-background-color { + background-color: #774e24; +} + +:root .editor-styles-wrapper .has-dark-red-color { + color: #640c1f; +} + +:root .editor-styles-wrapper .has-dark-red-background-color { + background-color: #640c1f; +} + +:root .editor-styles-wrapper .has-bright-red-color { + color: #ff675f; +} + +:root .editor-styles-wrapper .has-bright-red-background-color { + background-color: #ff675f; +} + +:root .editor-styles-wrapper .has-yellow-color { + color: #ffef8e; +} + +:root .editor-styles-wrapper .has-yellow-background-color { + background-color: #ffef8e; +} diff --git a/themes/twentysixteen/css/editor-style.css b/themes/twentysixteen/css/editor-style.css index ed48ce7f..e1b3445e 100644 --- a/themes/twentysixteen/css/editor-style.css +++ b/themes/twentysixteen/css/editor-style.css @@ -28,7 +28,7 @@ body { font-size: 16px; font-weight: 400; line-height: 1.75; - margin: 20px 40px; + margin: auto 20px; max-width: 600px; vertical-align: baseline; } @@ -120,10 +120,6 @@ blockquote { padding: 0 0 0 24px; } -blockquote:not(.alignleft):not(.alignright) { - margin-left: -28px; -} - blockquote blockquote:not(.alignleft):not(.alignright) { margin-left: 0; } @@ -188,7 +184,6 @@ pre { font-size: 16px; line-height: 1.3125; margin: 0 0 28px; - max-width: 100%; overflow: auto; padding: 14px; white-space: pre; @@ -519,7 +514,6 @@ fieldset { } .rtl blockquote:not(.alignleft):not(.alignright) { - margin-right: -28px; padding: 0 24px 0 0; } diff --git a/themes/twentysixteen/footer.php b/themes/twentysixteen/footer.php index 5fff3bd9..9f1621ff 100644 --- a/themes/twentysixteen/footer.php +++ b/themes/twentysixteen/footer.php @@ -58,7 +58,10 @@ } ?> - +
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 ); } @@ -493,6 +509,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. */ diff --git a/themes/twentysixteen/genericons/genericons.css b/themes/twentysixteen/genericons/genericons.css index 87cf754e..5b25675a 100644 --- a/themes/twentysixteen/genericons/genericons.css +++ b/themes/twentysixteen/genericons/genericons.css @@ -54,7 +54,7 @@ text-transform: none; -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; - speak: none; + speak: never; } diff --git a/themes/twentysixteen/header.php b/themes/twentysixteen/header.php index a5cfee6a..c6d3d8cc 100644 --- a/themes/twentysixteen/header.php +++ b/themes/twentysixteen/header.php @@ -14,7 +14,7 @@ - + @@ -85,7 +85,7 @@
@@ -36,7 +36,7 @@ get_header(); ?>
"%s"', 'twentysixteen' ), get_the_title() ), diff --git a/themes/twentysixteen/inc/back-compat.php b/themes/twentysixteen/inc/back-compat.php index c97940e0..bf1a8d08 100644 --- a/themes/twentysixteen/inc/back-compat.php +++ b/themes/twentysixteen/inc/back-compat.php @@ -38,8 +38,14 @@ add_action( 'after_switch_theme', 'twentysixteen_switch_theme' ); * @global string $wp_version WordPress version. */ function twentysixteen_upgrade_notice() { - $message = sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ); - printf( '

%s

', $message ); + printf( + '

%s

', + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), + $GLOBALS['wp_version'] + ) + ); } /** @@ -51,7 +57,11 @@ function twentysixteen_upgrade_notice() { */ function twentysixteen_customize() { wp_die( - sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ), + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), + $GLOBALS['wp_version'] + ), '', array( 'back_link' => true, @@ -69,7 +79,13 @@ add_action( 'load-customize.php', 'twentysixteen_customize' ); */ function twentysixteen_preview() { if ( isset( $_GET['preview'] ) ) { - wp_die( sprintf( __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), $GLOBALS['wp_version'] ) ); + wp_die( + sprintf( + /* translators: %s: The current WordPress version. */ + __( 'Twenty Sixteen requires at least WordPress version 4.4. You are running version %s. Please upgrade and try again.', 'twentysixteen' ), + $GLOBALS['wp_version'] + ) + ); } } add_action( 'template_redirect', 'twentysixteen_preview' ); diff --git a/themes/twentysixteen/inc/block-patterns.php b/themes/twentysixteen/inc/block-patterns.php new file mode 100644 index 00000000..69a80b2c --- /dev/null +++ b/themes/twentysixteen/inc/block-patterns.php @@ -0,0 +1,157 @@ + __( 'Twenty Sixteen', 'twentysixteen' ) ) + ); +} + +/** + * Register Block Patterns. + */ +if ( function_exists( 'register_block_pattern' ) ) { + register_block_pattern( + 'twentysixteen/large-heading-short-description', + array( + 'title' => __( 'Large heading with short description', 'twentysixteen' ), + 'categories' => array( 'twentysixteen' ), + 'content' => ' +
+ + + +
' . esc_html__( 'Twenty Sixteen is a modern take on the horizontal masthead with an optional right sidebar. It works perfectly for WordPress websites and blogs.', 'twentysixteen' ) . '
+ + +

' . esc_html__( 'Twenty Sixteen will make your WordPress website look beautiful everywhere. Take advantage of custom color options, beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail.', 'twentysixteen' ) . '

+ + + +
+ ', + ) + ); + + register_block_pattern( + 'twentysixteen/big-title-two-columns-text', + array( + 'title' => __( 'Big Title with Two Columns Text', 'twentysixteen' ), + 'categories' => array( 'twentysixteen' ), + 'content' => ' + + + + +

' . esc_html__( 'Twenty Sixteen' ) . '

+ + + + + + + +
+
+

' . esc_html__( 'Twenty Sixteen will make your WordPress website look beautiful everywhere. Take advantage of its custom color options and beautiful default color schemes.', 'twentysixteen' ) . '

+
+ + + +
+

' . esc_html__( 'The theme features a harmonious fluid grid using a mobile-first approach. The layout is a modern take on the horizontal masthead with an optional right sidebar. ', 'twentysixteen' ) . '

+
+
+ + + + + ', + ) + ); + + register_block_pattern( + 'twentysixteen/large-blockquote', + array( + 'title' => __( 'Large Blockquote', 'twentysixteen' ), + 'categories' => array( 'twentysixteen' ), + 'content' => ' + + + + +
+ + + +

' . esc_html__( 'Twenty Sixteen will make your WordPress look beautiful everywhere.', 'twentysixteen' ) . '

+ + + +

' . esc_html__( '— Takashi Irie', 'twentysixteen' ) . '

+ + + + + + + +
+ + + + + ', + ) + ); + + register_block_pattern( + 'twentysixteen/call-to-action', + array( + 'title' => __( 'Call to Action', 'twentysixteen' ), + 'categories' => array( 'twentysixteen' ), + 'content' => ' + + + + +
+ + + +

' . esc_html__( 'My new book “Twenty Sixteen” is available for pre-order.', 'twentysixteen' ) . '

+ + + + + + + + + ', + ) + ); +} diff --git a/themes/twentysixteen/inc/customizer.php b/themes/twentysixteen/inc/customizer.php index 9867d3d9..0cefa79e 100644 --- a/themes/twentysixteen/inc/customizer.php +++ b/themes/twentysixteen/inc/customizer.php @@ -19,19 +19,19 @@ function twentysixteen_custom_header_and_background() { $default_background_color = trim( $color_scheme[0], '#' ); $default_text_color = trim( $color_scheme[3], '#' ); - /** - * Filter the arguments used when adding 'custom-background' support in Twenty Sixteen. - * - * @since Twenty Sixteen 1.0 - * - * @param array $args { - * An array of custom-background support arguments. - * - * @type string $default-color Default color of the background. - * } - */ add_theme_support( 'custom-background', + /** + * Filters the arguments used when adding 'custom-background' support in Twenty Sixteen. + * + * @since Twenty Sixteen 1.0 + * + * @param array $args { + * An array of custom-background support arguments. + * + * @type string $default-color Default color of the background. + * } + */ apply_filters( 'twentysixteen_custom_background_args', array( @@ -40,24 +40,24 @@ function twentysixteen_custom_header_and_background() { ) ); - /** - * Filter the arguments used when adding 'custom-header' support in Twenty Sixteen. - * - * @since Twenty Sixteen 1.0 - * - * @param array $args { - * An array of custom-header support arguments. - * - * @type string $default-text-color Default color of the header text. - * @type int $width Width in pixels of the custom header image. Default 1200. - * @type int $height Height in pixels of the custom header image. Default 280. - * @type bool $flex-height Whether to allow flexible-height header images. Default true. - * @type callable $wp-head-callback Callback function used to style the header image and text - * displayed on the blog. - * } - */ add_theme_support( 'custom-header', + /** + * Filters the arguments used when adding 'custom-header' support in Twenty Sixteen. + * + * @since Twenty Sixteen 1.0 + * + * @param array $args { + * An array of custom-header support arguments. + * + * @type string $default-text-color Default color of the header text. + * @type int $width Width in pixels of the custom header image. Default 1200. + * @type int $height Height in pixels of the custom header image. Default 280. + * @type bool $flex-height Whether to allow flexible-height header images. Default true. + * @type callable $wp-head-callback Callback function used to style the header image and text + * displayed on the blog. + * } + */ apply_filters( 'twentysixteen_custom_header_args', array( @@ -103,7 +103,7 @@ if ( ! function_exists( 'twentysixteen_header_style' ) ) : '; + /* translators: %s: Post title. */ comments_popup_link( sprintf( __( 'Leave a comment on %s', 'twentysixteen' ), get_the_title() ) ); echo ''; } @@ -146,7 +147,7 @@ if ( ! function_exists( 'twentysixteen_post_thumbnail' ) ) : %2$s', esc_url( get_permalink( get_the_ID() ) ), - /* translators: %s: Name of current post */ + /* translators: %s: Post title. */ sprintf( __( 'Continue reading "%s"', 'twentysixteen' ), get_the_title( get_the_ID() ) ) ); return ' … ' . $link; @@ -209,7 +210,8 @@ if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : * @return bool True if there is more than one category, false otherwise. */ function twentysixteen_categorized_blog() { - if ( false === ( $all_the_cool_cats = get_transient( 'twentysixteen_categories' ) ) ) { + $all_the_cool_cats = get_transient( 'twentysixteen_categories' ); + if ( false === $all_the_cool_cats ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( @@ -226,10 +228,10 @@ if ( ! function_exists( 'twentysixteen_categorized_blog' ) ) : } if ( $all_the_cool_cats > 1 || is_preview() ) { - // This blog has more than 1 category so twentysixteen_categorized_blog should return true. + // This blog has more than 1 category so twentysixteen_categorized_blog() should return true. return true; } else { - // This blog has only 1 category so twentysixteen_categorized_blog should return false. + // This blog has only 1 category so twentysixteen_categorized_blog() should return false. return false; } } @@ -269,7 +271,7 @@ if ( ! function_exists( 'wp_body_open' ) ) : /** * Fire the wp_body_open action. * - * Added for backwards compatibility to support pre 5.2.0 WordPress versions. + * Added for backward compatibility to support pre-5.2.0 WordPress versions. * * @since Twenty Sixteen 2.0 */ diff --git a/themes/twentysixteen/index.php b/themes/twentysixteen/index.php index f6ec56c1..0a1a3e01 100644 --- a/themes/twentysixteen/index.php +++ b/themes/twentysixteen/index.php @@ -35,7 +35,8 @@ get_header(); ?> /* * Include the Post-Format-specific template for the content. * If you want to override this in a child theme, then include a file - * called content-___.php (where ___ is the Post Format name) and that will be used instead. + * called content-___.php (where ___ is the Post Format name) and that + * will be used instead. */ get_template_part( 'template-parts/content', get_post_format() ); diff --git a/themes/twentysixteen/js/functions.js b/themes/twentysixteen/js/functions.js index a15af117..d7aed1bd 100644 --- a/themes/twentysixteen/js/functions.js +++ b/themes/twentysixteen/js/functions.js @@ -28,7 +28,7 @@ // Add menu items with submenus to aria-haspopup="true". container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' ); - container.find( '.dropdown-toggle' ).click( function( e ) { + container.find( '.dropdown-toggle' ).on( 'click', function( e ) { var _this = $( this ), screenReaderSpan = _this.find( '.screen-reader-text' ); diff --git a/themes/twentysixteen/page.php b/themes/twentysixteen/page.php index a232c9fc..f5d6b7ad 100644 --- a/themes/twentysixteen/page.php +++ b/themes/twentysixteen/page.php @@ -28,7 +28,7 @@ get_header(); ?> comments_template(); } - // End of the loop. + // End the loop. endwhile; ?> diff --git a/themes/twentysixteen/readme.txt b/themes/twentysixteen/readme.txt index 24b3428c..61bbd5f1 100644 --- a/themes/twentysixteen/readme.txt +++ b/themes/twentysixteen/readme.txt @@ -1,12 +1,10 @@ === Twenty Sixteen === Contributors: wordpressdotorg -Requires at least: WordPress 4.4 -Tested up to: WordPress 5.0 -Requires PHP: 5.2.4 -Version: 2.0 +Tested up to: 5.8 +Version: 2.5 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog +Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog, block-patterns == Description == Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. @@ -18,19 +16,19 @@ Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the * Post Formats * The GPL v2.0 or later license. :) Use it to make something cool. -For more information about Twenty Sixteen please go to https://codex.wordpress.org/Twenty_Sixteen. +For more information about Twenty Sixteen please go to https://wordpress.org/support/article/twenty-sixteen/. == Installation == 1. In your admin panel, go to Appearance -> Themes and click the 'Add New' button. 2. Type in Twenty Sixteen in the search form and press the 'Enter' key on your keyboard. 3. Click on the 'Activate' button to use your new theme right away. -4. Go to https://codex.wordpress.org/Twenty_Sixteen for a guide on how to customize this theme. +4. Go to https://wordpress.org/support/article/twenty-sixteen/ for a guide on how to customize this theme. 5. Navigate to Appearance > Customize in your admin panel and customize to taste. == Copyright == -Twenty Sixteen WordPress Theme, Copyright 2014-2018 WordPress.org +Twenty Sixteen WordPress Theme, Copyright 2014-2021 WordPress.org Twenty Sixteen is distributed under the terms of the GNU GPL This program is free software: you can redistribute it and/or modify @@ -57,6 +55,31 @@ Image used in screenshot.png: A photo by Austin Schmid (https://unsplash.com/sch == Changelog == += 2.5 = +* Released: July 20, 2021 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.5 + += 2.4 = +* Released: March 9, 2021 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.4 + += 2.3 = +* Released: December 8, 2020 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.3 + += 2.2 = +* Released: August 11, 2020 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.2 + += 2.1 = +* Released: March 31, 2020 + +https://codex.wordpress.org/Twenty_Sixteen_Theme_Changelog#Version_2.1 + = 2.0 = * Released: May 7, 2019 diff --git a/themes/twentysixteen/rtl.css b/themes/twentysixteen/rtl.css index 48ece280..5add22f5 100644 --- a/themes/twentysixteen/rtl.css +++ b/themes/twentysixteen/rtl.css @@ -681,7 +681,7 @@ body:not(.search-results) .entry-summary .alignleft { margin-right: 1.473684211em; margin-left: 0; width: -webkit-calc(50% - 0.736842105em); - width: calc(50% - 0.736842105em);; + width: calc(50% - 0.736842105em); } body:not(.search-results) article:not(.type-page) .entry-content > blockquote.alignright.below-entry-meta { diff --git a/themes/twentysixteen/search.php b/themes/twentysixteen/search.php index 0f893636..37aed863 100644 --- a/themes/twentysixteen/search.php +++ b/themes/twentysixteen/search.php @@ -15,7 +15,12 @@ get_header(); ?> ); } - // End of the loop. + // End the loop. endwhile; ?> diff --git a/themes/twentysixteen/style.css b/themes/twentysixteen/style.css index ab7e95da..a34e74d6 100644 --- a/themes/twentysixteen/style.css +++ b/themes/twentysixteen/style.css @@ -4,10 +4,12 @@ Theme URI: https://wordpress.org/themes/twentysixteen/ Author: the WordPress team Author URI: https://wordpress.org/ Description: Twenty Sixteen is a modernized take on an ever-popular WordPress layout — the horizontal masthead with an optional right sidebar that works perfectly for blogs and websites. It has custom color options with beautiful default color schemes, a harmonious fluid grid using a mobile-first approach, and impeccable polish in every detail. Twenty Sixteen will make your WordPress look beautiful everywhere. -Version: 2.0 +Version: 2.5 +Requires at least: 4.4 +Requires PHP: 5.2.4 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html -Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog +Tags: one-column, two-columns, right-sidebar, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready, blog, block-patterns Text Domain: twentysixteen This theme, like WordPress, is licensed under the GPL. @@ -286,7 +288,7 @@ optgroup { font-variant: normal; font-weight: normal; line-height: 1; - speak: none; + speak: never; text-align: center; text-decoration: inherit; text-transform: none; @@ -1411,7 +1413,8 @@ blockquote:after, } .widget-area > :last-child, -.widget > :last-child { +.widget > :last-child, +.widget > nav > :last-child { margin-bottom: 0; } @@ -1438,8 +1441,23 @@ blockquote:after, margin: 0; } +.widget_calendar .wp-calendar-nav { + display: table; + width: 100%; +} + +.widget_calendar .wp-calendar-nav span { + display: table-cell; +} + +.widget_calendar .wp-calendar-nav-prev, +.widget_calendar .wp-calendar-nav-next { + width: 40%; +} + .widget_calendar td, -.widget_calendar th { +.widget_calendar th, +.widget_calendar .wp-calendar-nav span { line-height: 2.5625; padding: 0; text-align: center; @@ -3302,7 +3320,8 @@ p > video { } .widget_calendar td, - .widget_calendar th { + .widget_calendar th, + .widget_calendar .wp-calendar-nav span { line-height: 2.6923076923; padding: 0; } diff --git a/themes/twentysixteen/template-parts/biography.php b/themes/twentysixteen/template-parts/biography.php index 9e2e5b87..15aa70cd 100644 --- a/themes/twentysixteen/template-parts/biography.php +++ b/themes/twentysixteen/template-parts/biography.php @@ -12,7 +12,7 @@ diff --git a/themes/twentysixteen/template-parts/content-none.php b/themes/twentysixteen/template-parts/content-none.php index b6b7e7c0..ad401cf9 100644 --- a/themes/twentysixteen/template-parts/content-none.php +++ b/themes/twentysixteen/template-parts/content-none.php @@ -16,7 +16,12 @@
-

Get started here.', 'twentysixteen' ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

+

+ Get started here.', 'twentysixteen' ), esc_url( admin_url( 'post-new.php' ) ) ); + ?> +

diff --git a/themes/twentysixteen/template-parts/content-page.php b/themes/twentysixteen/template-parts/content-page.php index 689972c0..58af8e0b 100644 --- a/themes/twentysixteen/template-parts/content-page.php +++ b/themes/twentysixteen/template-parts/content-page.php @@ -35,7 +35,7 @@ "%s"', 'twentysixteen' ), get_the_title() ), diff --git a/themes/twentysixteen/template-parts/content-search.php b/themes/twentysixteen/template-parts/content-search.php index 7d587f65..6a912eb0 100644 --- a/themes/twentysixteen/template-parts/content-search.php +++ b/themes/twentysixteen/template-parts/content-search.php @@ -24,7 +24,7 @@ "%s"', 'twentysixteen' ), get_the_title() ), @@ -39,7 +39,7 @@ "%s"', 'twentysixteen' ), get_the_title() ), diff --git a/themes/twentysixteen/template-parts/content-single.php b/themes/twentysixteen/template-parts/content-single.php index 23e18373..1eb9f267 100644 --- a/themes/twentysixteen/template-parts/content-single.php +++ b/themes/twentysixteen/template-parts/content-single.php @@ -43,7 +43,7 @@ "%s"', 'twentysixteen' ), get_the_title() ), diff --git a/themes/twentysixteen/template-parts/content.php b/themes/twentysixteen/template-parts/content.php index 03b4cfb6..1497c76c 100644 --- a/themes/twentysixteen/template-parts/content.php +++ b/themes/twentysixteen/template-parts/content.php @@ -23,9 +23,9 @@
"%s"', 'twentysixteen' ), get_the_title() ) @@ -49,7 +49,7 @@ "%s"', 'twentysixteen' ), get_the_title() ), -- cgit v1.2.3