updated theme `Twenty Nineteen` version 2.7

This commit is contained in:
KawaiiPunk 2023-12-08 23:24:42 +00:00 committed by Gitium
parent fc1539e777
commit 68d0f8ee2d
17 changed files with 4346 additions and 169 deletions

View File

@ -454,5 +454,4 @@ class TwentyNineteen_SVG_Icons {
</svg>',
);
}

View File

@ -87,13 +87,22 @@ $discussion = twentynineteen_get_discussion_data();
// Show comment navigation.
if ( have_comments() ) :
$prev_icon = twentynineteen_get_icon_svg( 'chevron_left', 22 );
$next_icon = twentynineteen_get_icon_svg( 'chevron_right', 22 );
$comments_text = __( 'Comments', 'twentynineteen' );
$prev_icon = twentynineteen_get_icon_svg( 'chevron_left', 22 );
$next_icon = twentynineteen_get_icon_svg( 'chevron_right', 22 );
the_comments_navigation(
array(
'prev_text' => sprintf( '%s <span class="nav-prev-text"><span class="primary-text">%s</span> <span class="secondary-text">%s</span></span>', $prev_icon, __( 'Previous', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ) ),
'next_text' => sprintf( '<span class="nav-next-text"><span class="primary-text">%s</span> <span class="secondary-text">%s</span></span> %s', __( 'Next', 'twentynineteen' ), __( 'Comments', 'twentynineteen' ), $next_icon ),
'prev_text' => sprintf(
'%1$s <span class="nav-prev-text">%2$s</span>',
$prev_icon,
/* translators: Comments navigation link text. The secondary-text element is hidden on small screens. */
__( '<span class="primary-text">Previous</span> <span class="secondary-text">Comments</span>', 'twentynineteen' )
),
'next_text' => sprintf(
'<span class="nav-next-text">%1$s</span> %2$s',
/* translators: Comments navigation link text. The secondary-text element is hidden on small screens. */
__( '<span class="primary-text">Next</span> <span class="secondary-text">Comments</span>', 'twentynineteen' ),
$next_icon
),
)
);
endif;

View File

@ -26,13 +26,6 @@ if ( ! function_exists( 'twentynineteen_setup' ) ) :
* as indicating support for post thumbnails.
*/
function twentynineteen_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Twenty Nineteen, use a find and replace
* to change 'twentynineteen' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'twentynineteen', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
@ -146,12 +139,12 @@ if ( ! function_exists( 'twentynineteen_setup' ) ) :
'editor-color-palette',
array(
array(
'name' => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Blue', 'twentynineteen' ) : null,
'name' => 'default' === get_theme_mod( 'primary_color', 'default' ) ? __( 'Blue', 'twentynineteen' ) : null,
'slug' => 'primary',
'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 33 ),
),
array(
'name' => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Dark Blue', 'twentynineteen' ) : null,
'name' => 'default' === get_theme_mod( 'primary_color', 'default' ) ? __( 'Dark Blue', 'twentynineteen' ) : null,
'slug' => 'secondary',
'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 23 ),
),
@ -214,7 +207,6 @@ function twentynineteen_widgets_init() {
'after_title' => '</h2>',
)
);
}
add_action( 'widgets_init', 'twentynineteen_widgets_init' );
@ -266,8 +258,26 @@ function twentynineteen_scripts() {
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
if ( has_nav_menu( 'menu-1' ) ) {
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '20200129', true );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '20221101', true );
wp_enqueue_script(
'twentynineteen-priority-menu',
get_theme_file_uri( '/js/priority-menu.js' ),
array(),
'20200129',
array(
'in_footer' => false, // Because involves header.
'strategy' => 'defer',
)
);
wp_enqueue_script(
'twentynineteen-touch-navigation',
get_theme_file_uri( '/js/touch-keyboard-navigation.js' ),
array(),
'20230621',
array(
'in_footer' => true,
'strategy' => 'defer',
)
);
}
wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );
@ -284,6 +294,9 @@ add_action( 'wp_enqueue_scripts', 'twentynineteen_scripts' );
* This does not enqueue the script because it is tiny and because it is only for IE11,
* thus it does not warrant having an entire dedicated blocking script being loaded.
*
* @since Twenty Nineteen 1.0
* @deprecated Twenty Nineteen 2.6 Removed from wp_print_footer_scripts action.
*
* @link https://git.io/vWdr2
*/
function twentynineteen_skip_link_focus_fix() {
@ -294,14 +307,13 @@ function twentynineteen_skip_link_focus_fix() {
</script>
<?php
}
add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );
/**
* Enqueue supplemental block editor styles.
*/
function twentynineteen_editor_customizer_styles() {
wp_enqueue_style( 'twentynineteen-editor-customizer-styles', get_theme_file_uri( '/style-editor-customizer.css' ), false, '1.1', 'all' );
wp_enqueue_style( 'twentynineteen-editor-customizer-styles', get_theme_file_uri( '/style-editor-customizer.css' ), false, '2.1', 'all' );
if ( 'custom' === get_theme_mod( 'primary_color' ) ) {
// Include color patterns.

View File

@ -125,7 +125,7 @@ function twentynineteen_customize_partial_blogdescription() {
* Bind JS handlers to instantly live-preview changes.
*/
function twentynineteen_customize_preview_js() {
wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', true );
wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181214', array( 'in_footer' => true ) );
}
add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );
@ -133,7 +133,7 @@ add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );
* Load dynamic logic for the customizer controls area.
*/
function twentynineteen_panels_js() {
wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', true );
wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181214', array( 'in_footer' => true ) );
}
add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );

View File

@ -40,7 +40,7 @@ function twentynineteen_get_social_link_svg( $uri, $size = 24 ) {
function twentynineteen_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
if ( 'social' === $args->theme_location ) {
$svg = twentynineteen_get_social_link_svg( $item->url, 26 );
$svg = twentynineteen_get_social_link_svg( $item->url, 32 );
if ( empty( $svg ) ) {
$svg = twentynineteen_get_icon_svg( 'link' );
}

View File

@ -1,6 +1,6 @@
<?php
/**
* Functions which enhance the theme by hooking into WordPress
* Functions which enhance the theme by hooking into WordPress.
*
* @package WordPress
* @subpackage Twenty_Nineteen
@ -34,17 +34,19 @@ add_filter( 'body_class', 'twentynineteen_body_classes' );
/**
* Adds custom class to the array of posts classes.
*
* @param array $classes A list of existing post class values.
* @return array The filtered post class list.
*/
function twentynineteen_post_classes( $classes, $css_class, $post_id ) {
function twentynineteen_post_classes( $classes ) {
$classes[] = 'entry';
return $classes;
}
add_filter( 'post_class', 'twentynineteen_post_classes', 10, 3 );
add_filter( 'post_class', 'twentynineteen_post_classes' );
/**
* Add a pingback url auto-discovery header for single posts, pages, or attachments.
* Adds a pingback url auto-discovery header for single posts, pages, or attachments.
*/
function twentynineteen_pingback_header() {
if ( is_singular() && pings_open() ) {
@ -96,7 +98,7 @@ function twentynineteen_get_the_archive_title() {
add_filter( 'get_the_archive_title', 'twentynineteen_get_the_archive_title' );
/**
* Add custom 'sizes' attribute to responsive image functionality for post thumbnails.
* Adds custom 'sizes' attribute to responsive image functionality for post thumbnails.
*
* @origin Twenty Nineteen 1.0
*
@ -116,13 +118,13 @@ function twentynineteen_post_thumbnail_sizes_attr( $attr ) {
return $attr;
}
add_filter( 'wp_get_attachment_image_attributes', 'twentynineteen_post_thumbnail_sizes_attr', 10, 1 );
add_filter( 'wp_get_attachment_image_attributes', 'twentynineteen_post_thumbnail_sizes_attr' );
/**
* Add an extra menu to our nav for our priority+ navigation to use
* Adds an extra menu to our nav for our priority+ navigation to use.
*
* @param string $nav_menu Nav menu.
* @param object $args Nav menu args.
* @param string $nav_menu Nav menu.
* @param object $args Nav menu args.
* @return string More link for hidden menu items.
*/
function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) {
@ -156,14 +158,25 @@ function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) {
add_filter( 'wp_nav_menu', 'twentynineteen_add_ellipses_to_nav', 10, 2 );
/**
* WCAG 2.0 Attributes for Dropdown Menus
* Handles WCAG 2.0 attributes for dropdown menus.
*
* Adjustments to menu attributes tot support WCAG 2.0 recommendations
* Adjustments to menu attributes to support WCAG 2.0 recommendations
* for flyout and dropdown menus.
*
* @ref https://www.w3.org/WAI/tutorials/menus/flyout/
* @param array $atts {
* The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
*
* @type string $title Title attribute.
* @type string $target Target attribute.
* @type string $rel The rel attribute.
* @type string $href The href attribute.
* @type string $aria-current The aria-current attribute.
* }
* @param WP_Post $item The current menu item object.
* @return string[] Modified attributes.
*/
function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth ) {
function twentynineteen_nav_menu_link_attributes( $atts, $item ) {
// Add [aria-haspopup] and [aria-expanded] to menu items that have children.
$item_has_children = in_array( 'menu-item-has-children', $item->classes, true );
@ -174,10 +187,10 @@ function twentynineteen_nav_menu_link_attributes( $atts, $item, $args, $depth )
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 4 );
add_filter( 'nav_menu_link_attributes', 'twentynineteen_nav_menu_link_attributes', 10, 2 );
/**
* Create a nav menu item to be displayed on mobile to navigate from submenu back to the parent.
* Creates a nav menu item to be displayed on mobile to navigate from submenu back to the parent.
*
* This duplicates each parent nav menu item and makes it the first child of itself.
*
@ -210,3 +223,20 @@ function twentynineteen_add_mobile_parent_nav_menu_items( $sorted_menu_items, $a
return $amended_menu_items;
}
add_filter( 'wp_nav_menu_objects', 'twentynineteen_add_mobile_parent_nav_menu_items', 10, 2 );
/**
* Adds a fragment identifier (to the content) to paginated links.
*
* @since Twenty Nineteen 2.6
*
* @param string $link The page number HTML output.
* @param int $i Page number for paginated posts' page links.
* @return string Formatted output in HTML.
*/
function twentynineteen_link_pages_link( $link, $i ) {
if ( $i > 1 && preg_match( '/href="([^"]*)"/', $link, $matches ) ) {
$link = str_replace( $matches[1], $matches[1] . '#content', $link );
}
return $link;
}
add_filter( 'wp_link_pages_link', 'twentynineteen_link_pages_link', 10, 2 );

View File

@ -274,7 +274,7 @@
document.addEventListener('focus', function(event) {
if ( event.target.matches('.main-navigation > div > ul > li a') ) {
if ( event.target !== window.document && event.target.matches( '.main-navigation > div > ul > li a' ) ) {
// Remove Focused elements in sibling div.
var currentDiv = getCurrentParent( event.target, 'div', '.main-navigation' );

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,21 @@
{
"name": "twentynineteen",
"version": "2.5.0",
"version": "2.7.0",
"description": "Default WP Theme",
"bugs": {
"url": "https://core.trac.wordpress.org/"
},
"homepage": "https://wordpress.org/themes/twentynineteen/",
"devDependencies": {
"@wordpress/browserslist-config": "^5.9.0",
"autoprefixer": "^10.4.13",
"@wordpress/browserslist-config": "^5.24.0",
"autoprefixer": "^10.4.15",
"chokidar-cli": "^3.0.0",
"node-sass": "^8.0.0",
"node-sass": "^9.0.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.21",
"postcss": "^8.4.29",
"postcss-cli": "^10.1.0",
"postcss-focus-within": "^7.0.2",
"rtlcss": "^4.0.0"
"postcss-focus-within": "^8.0.0",
"rtlcss": "^4.1.0"
},
"rtlcssConfig": {
"options": {

View File

@ -1,9 +1,10 @@
=== Twenty Nineteen ===
Contributors: wordpressdotorg
Tags: one-column, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready, block-patterns
Requires at least: 4.9.6
Tested up to: 6.2
Stable tag: 2.5
Requires at least: 4.7
Tested up to: 6.4
Requires PHP: 5.2.4
Stable tag: 2.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -39,6 +40,16 @@ GNU General Public License for more details.
== Changelog ==
= 2.7 =
* Released: November 7, 2023
https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_2.7
= 2.6 =
* Released: August 8, 2023
https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_2.6
= 2.5 =
* Released: March 28, 2023

View File

@ -16,10 +16,6 @@ html {
box-sizing: inherit;
}
body {
background-color: $color__background-body;
}
a {
@include link-transition;
color: $color__link;

View File

@ -6,6 +6,7 @@ html {
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: $color__background-body;
color: $color__text-main;
@include font-family( $font__body );
font-weight: 400;

View File

@ -605,7 +605,7 @@ body .wp-block.aligncenter {
}
@media only screen and (min-width: 768px) {
body.block-editor-writing-flow,
body.block-editor-iframe__body, body.block-editor-writing-flow,
body .block-editor-writing-flow {
max-width: 80%;
margin: 0 10%;
@ -1005,7 +1005,7 @@ figcaption,
/** === Button === */
.wp-block-button .wp-block-button__link {
line-height: 1.8;
line-height: inherit;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
font-size: 0.88889em;
font-weight: bold;
@ -1276,6 +1276,31 @@ figcaption,
padding-left: calc(2 * 1rem);
}
.wp-block-separator.has-primary-background-color {
color: #0073aa;
background-color: #0073aa;
}
.wp-block-separator.has-secondary-background-color {
color: #005177;
background-color: #005177;
}
.wp-block-separator.has-dark-gray-background-color {
color: #111;
background-color: #111;
}
.wp-block-separator.has-light-gray-background-color {
color: #767676;
background-color: #767676;
}
.wp-block-separator.has-white-background-color {
color: #fff;
background-color: #fff;
}
/* Remove duplicate rule-line when a separator
* is followed by an H1, or H2 */
.wp-block[data-type="core/separator"] + .wp-block[data-type="core/heading"] h1:before,

View File

@ -36,6 +36,7 @@ body {
@include media(tablet) {
&.block-editor-iframe__body,
&.block-editor-writing-flow,
.block-editor-writing-flow {
max-width: 80%;
@ -381,7 +382,7 @@ figcaption,
.wp-block-button {
.wp-block-button__link {
line-height: 1.8;
line-height:inherit;
@include font-family( $font__heading );
font-size: $font__size-sm;
font-weight: bold;
@ -651,6 +652,31 @@ figcaption,
letter-spacing: calc(2 * #{$size__spacing-unit});
padding-left: calc(2 * #{$size__spacing-unit});
}
&.has-primary-background-color {
color: $color__link;
background-color: $color__link;
}
&.has-secondary-background-color {
color: $color__border-link-hover;
background-color: $color__border-link-hover;
}
&.has-dark-gray-background-color {
color: $color__text-main;
background-color: $color__text-main;
}
&.has-light-gray-background-color {
color: $color__text-light;
background-color: $color__text-light;
}
&.has-white-background-color {
color: #fff;
background-color: #fff;
}
}
/* Remove duplicate rule-line when a separator

View File

@ -5,10 +5,10 @@ Theme URI: https://wordpress.org/themes/twentynineteen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether youre running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes.
Tested up to: 6.2
Requires at least: 4.9.6
Tested up to: 6.4
Requires at least: 4.7
Requires PHP: 5.2.4
Version: 2.5
Version: 2.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentynineteen
@ -2219,6 +2219,7 @@ html {
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #fff;
color: #111;
font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif;
font-weight: 400;
@ -2493,10 +2494,6 @@ html {
box-sizing: inherit;
}
body {
background-color: #fff;
}
a {
transition: color 110ms ease-in-out;
color: #0073aa;

View File

@ -5,10 +5,10 @@ Theme URI: https://wordpress.org/themes/twentynineteen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether youre running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes.
Tested up to: 6.2
Requires at least: 4.9.6
Tested up to: 6.4
Requires at least: 4.7
Requires PHP: 5.2.4
Version: 2.5
Version: 2.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentynineteen
@ -2219,6 +2219,7 @@ html {
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: #fff;
color: #111;
font-family: "NonBreakingSpaceOverride", "Hoefler Text", Garamond, "Times New Roman", serif;
font-weight: 400;
@ -2493,10 +2494,6 @@ html {
box-sizing: inherit;
}
body {
background-color: #fff;
}
a {
transition: color 110ms ease-in-out;
color: #0073aa;

View File

@ -4,10 +4,10 @@ Theme URI: https://wordpress.org/themes/twentynineteen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether youre running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes.
Tested up to: 6.2
Requires at least: 4.9.6
Tested up to: 6.4
Requires at least: 4.7
Requires PHP: 5.2.4
Version: 2.5
Version: 2.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentynineteen