Commit 201e97b9 authored by lucha's avatar lucha
Browse files

Wordpress 5.0.3

parent 7dc5c3fa
WordPress - Web publishing software WordPress - Web publishing software
Copyright 2011-2018 by the contributors Copyright 2011-2019 by the contributors
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
...@@ -65,7 +65,25 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ...@@ -65,7 +65,25 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<p> <p>
<?php <?php
printf( printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */ /* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
44
),
'5.0.3',
number_format_i18n( 44 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_5.0.3' );
?>
</p>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n( _n(
'<strong>Version %1$s</strong> addressed %2$s bug.', '<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.', '<strong>Version %1$s</strong> addressed %2$s bugs.',
......
...@@ -560,6 +560,10 @@ code { ...@@ -560,6 +560,10 @@ code {
margin: 10px 2px 0 20px; margin: 10px 2px 0 20px;
} }
.wrap.block-editor-no-js {
padding-right: 20px;
}
.wrap > h2:first-child, /* Back-compat for pre-4.4 */ .wrap > h2:first-child, /* Back-compat for pre-4.4 */
.wrap [class$="icon32"] + h2, /* Back-compat for pre-4.4 */ .wrap [class$="icon32"] + h2, /* Back-compat for pre-4.4 */
.postbox .inside h2, /* Back-compat for pre-4.4 */ .postbox .inside h2, /* Back-compat for pre-4.4 */
......
This diff is collapsed.
...@@ -560,6 +560,10 @@ code { ...@@ -560,6 +560,10 @@ code {
margin: 10px 20px 0 2px; margin: 10px 20px 0 2px;
} }
.wrap.block-editor-no-js {
padding-left: 20px;
}
.wrap > h2:first-child, /* Back-compat for pre-4.4 */ .wrap > h2:first-child, /* Back-compat for pre-4.4 */
.wrap [class$="icon32"] + h2, /* Back-compat for pre-4.4 */ .wrap [class$="icon32"] + h2, /* Back-compat for pre-4.4 */
.postbox .inside h2, /* Back-compat for pre-4.4 */ .postbox .inside h2, /* Back-compat for pre-4.4 */
......
This diff is collapsed.
...@@ -23,10 +23,6 @@ if ( ! defined( 'ABSPATH' ) ) { ...@@ -23,10 +23,6 @@ if ( ! defined( 'ABSPATH' ) ) {
*/ */
global $post_type, $post_type_object, $post, $title, $editor_styles, $wp_meta_boxes; global $post_type, $post_type_object, $post, $title, $editor_styles, $wp_meta_boxes;
if ( ! empty( $post_type_object ) ) {
$title = $post_type_object->labels->edit_item;
}
// Flag that we're loading the block editor. // Flag that we're loading the block editor.
$current_screen = get_current_screen(); $current_screen = get_current_screen();
$current_screen->is_block_editor( true ); $current_screen->is_block_editor( true );
...@@ -399,9 +395,36 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ...@@ -399,9 +395,36 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
?> ?>
<div class="block-editor"> <div class="block-editor">
<h1 class="screen-reader-text"><?php echo esc_html( $post_type_object->labels->edit_item ); ?></h1> <h1 class="screen-reader-text hide-if-no-js"><?php echo esc_html( $title ); ?></h1>
<div id="editor" class="block-editor__container"></div> <div id="editor" class="block-editor__container hide-if-no-js"></div>
<div id="metaboxes" class="hidden"> <div id="metaboxes" class="hidden">
<?php the_block_editor_meta_boxes(); ?> <?php the_block_editor_meta_boxes(); ?>
</div> </div>
<?php // JavaScript is disabled. ?>
<div class="wrap hide-if-js block-editor-no-js">
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
<div class="notice notice-error notice-alt">
<p>
<?php
$message = sprintf(
/* translators: %s: https://wordpress.org/plugins/classic-editor/ */
__( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ),
__( 'https://wordpress.org/plugins/classic-editor/' )
);
/**
* Filters the message displayed in the block editor interface when JavaScript is
* not enabled in the browser.
*
* @since 5.0.3
*
* @param string $message The message being displayed.
* @param WP_Post $post The post being edited.
*/
echo apply_filters( 'block_editor_no_javascript_message', $message, $post );
?>
</p>
</div>
</div>
</div> </div>
...@@ -150,6 +150,8 @@ case 'edit': ...@@ -150,6 +150,8 @@ case 'edit':
$post_new_file = "post-new.php?post_type=$post_type"; $post_new_file = "post-new.php?post_type=$post_type";
} }
$title = $post_type_object->labels->edit_item;
/** /**
* Allows replacement of the editor. * Allows replacement of the editor.
* *
...@@ -174,8 +176,7 @@ case 'edit': ...@@ -174,8 +176,7 @@ case 'edit':
wp_enqueue_script('autosave'); wp_enqueue_script('autosave');
} }
$title = $post_type_object->labels->edit_item; $post = get_post( $post_id, OBJECT, 'edit' );
$post = get_post($post_id, OBJECT, 'edit');
if ( post_type_supports($post_type, 'comments') ) { if ( post_type_supports($post_type, 'comments') ) {
wp_enqueue_script('admin-comments'); wp_enqueue_script('admin-comments');
......
...@@ -222,8 +222,8 @@ function twentynineteen_scripts() { ...@@ -222,8 +222,8 @@ function twentynineteen_scripts() {
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' ); wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
if ( has_nav_menu( 'menu-1' ) ) { if ( has_nav_menu( 'menu-1' ) ) {
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.0', true ); wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.1', true );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.0', true ); wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.1', true );
} }
wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' ); wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );
...@@ -257,7 +257,7 @@ add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' ); ...@@ -257,7 +257,7 @@ add_action( 'wp_print_footer_scripts', 'twentynineteen_skip_link_focus_fix' );
*/ */
function twentynineteen_editor_customizer_styles() { function twentynineteen_editor_customizer_styles() {
wp_enqueue_style( 'twentynineteen-editor-customizer-styles', get_theme_file_uri( '/style-editor-customizer.css' ), false, '1.0', 'all' ); wp_enqueue_style( 'twentynineteen-editor-customizer-styles', get_theme_file_uri( '/style-editor-customizer.css' ), false, '1.1', 'all' );
if ( 'custom' === get_theme_mod( 'primary_color' ) ) { if ( 'custom' === get_theme_mod( 'primary_color' ) ) {
// Include color patterns. // Include color patterns.
......
...@@ -125,7 +125,7 @@ function twentynineteen_customize_partial_blogdescription() { ...@@ -125,7 +125,7 @@ function twentynineteen_customize_partial_blogdescription() {
* Bind JS handlers to instantly live-preview changes. * Bind JS handlers to instantly live-preview changes.
*/ */
function twentynineteen_customize_preview_js() { function twentynineteen_customize_preview_js() {
wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181108', true ); wp_enqueue_script( 'twentynineteen-customize-preview', get_theme_file_uri( '/js/customize-preview.js' ), array( 'customize-preview' ), '20181231', true );
} }
add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' ); add_action( 'customize_preview_init', 'twentynineteen_customize_preview_js' );
...@@ -133,7 +133,7 @@ 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. * Load dynamic logic for the customizer controls area.
*/ */
function twentynineteen_panels_js() { function twentynineteen_panels_js() {
wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181031', true ); wp_enqueue_script( 'twentynineteen-customize-controls', get_theme_file_uri( '/js/customize-controls.js' ), array(), '20181231', true );
} }
add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' ); add_action( 'customize_controls_enqueue_scripts', 'twentynineteen_panels_js' );
......
...@@ -203,18 +203,18 @@ function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) { ...@@ -203,18 +203,18 @@ function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) {
if ( 'menu-1' === $args->theme_location ) : if ( 'menu-1' === $args->theme_location ) :
$nav_menu .= '<div class="main-menu-more">'; $nav_menu .= '<div class="main-menu-more">';
$nav_menu .= '<ul class="main-menu" tabindex="0">'; $nav_menu .= '<ul class="main-menu">';
$nav_menu .= '<li class="menu-item menu-item-has-children">'; $nav_menu .= '<li class="menu-item menu-item-has-children">';
$nav_menu .= '<a href="#" class="screen-reader-text" aria-label="More" aria-haspopup="true" aria-expanded="false">' . esc_html__( 'More', 'twentynineteen' ) . '</a>'; $nav_menu .= '<button class="submenu-expand main-menu-more-toggle is-empty" tabindex="-1" aria-label="More" aria-haspopup="true" aria-expanded="false">';
$nav_menu .= '<span class="submenu-expand main-menu-more-toggle is-empty" tabindex="-1">'; $nav_menu .= '<span class="screen-reader-text">' . esc_html__( 'More', 'twentynineteen' ) . '</span>';
$nav_menu .= twentynineteen_get_icon_svg( 'arrow_drop_down_ellipsis' ); $nav_menu .= twentynineteen_get_icon_svg( 'arrow_drop_down_ellipsis' );
$nav_menu .= '</span>'; $nav_menu .= '</button>';
$nav_menu .= '<ul class="sub-menu hidden-links">'; $nav_menu .= '<ul class="sub-menu hidden-links">';
$nav_menu .= '<li id="menu-item--1" class="mobile-parent-nav-menu-item menu-item--1">'; $nav_menu .= '<li id="menu-item--1" class="mobile-parent-nav-menu-item menu-item--1">';
$nav_menu .= '<span class="menu-item-link-return">'; $nav_menu .= '<button class="menu-item-link-return">';
$nav_menu .= twentynineteen_get_icon_svg( 'chevron_left' ); $nav_menu .= twentynineteen_get_icon_svg( 'chevron_left' );
$nav_menu .= esc_html__( 'Back', 'twentynineteen' ); $nav_menu .= esc_html__( 'Back', 'twentynineteen' );
$nav_menu .= '</span>'; $nav_menu .= '</button>';
$nav_menu .= '</li>'; $nav_menu .= '</li>';
$nav_menu .= '</ul>'; $nav_menu .= '</ul>';
$nav_menu .= '</li>'; $nav_menu .= '</li>';
...@@ -269,11 +269,11 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) { ...@@ -269,11 +269,11 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
// Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item. // Inject the keyboard_arrow_left SVG inside the parent nav menu item, and let the item link to the parent item.
// @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely. // @todo Only do this for nested submenus? If on a first-level submenu, then really the link could be "#" since the desire is to remove the target entirely.
$link = sprintf( $link = sprintf(
'<span class="menu-item-link-return" tabindex="-1">%s', '<button class="menu-item-link-return" tabindex="-1">%s',
twentynineteen_get_icon_svg( 'chevron_left', 24 ) twentynineteen_get_icon_svg( 'chevron_left', 24 )
); );
// replace opening <a> with <span> // replace opening <a> with <button>
$output = preg_replace( $output = preg_replace(
'/<a\s.*?>/', '/<a\s.*?>/',
$link, $link,
...@@ -281,10 +281,10 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) { ...@@ -281,10 +281,10 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
1 // Limit. 1 // Limit.
); );
// replace closing </a> with </span> // replace closing </a> with </button>
$output = preg_replace( $output = preg_replace(
'#</a>#i', '#</a>#i',
'</span>', '</button>',
$output, $output,
1 // Limit. 1 // Limit.
); );
...@@ -295,7 +295,7 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) { ...@@ -295,7 +295,7 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 ); $icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );
$output .= sprintf( $output .= sprintf(
'<span class="submenu-expand" tabindex="-1">%s</span>', '<button class="submenu-expand" tabindex="-1">%s</button>',
$icon $icon
); );
} }
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
currentSubMenu.parentElement.lastElementChild.className += ' expanded-true'; currentSubMenu.parentElement.lastElementChild.className += ' expanded-true';
// Update aria-expanded state // Update aria-expanded state
toggleAriaExpandedState( currentSubMenu.previousSibling ); toggleAriaExpandedState( currentSubMenu );
} }
/** /**
...@@ -219,19 +219,9 @@ ...@@ -219,19 +219,9 @@
var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : ''; var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : '';
// If there’s a link, go to it on touchend
if ( '#' !== url && '' !== url ) {
window.location = url;
// Open submenu if url is # // Open submenu if url is #
} else if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) { if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) {
openSubMenu( event.target ); openSubMenu( event.target );
// Prevent default touch events
} else {
event.preventDefault();
} }
} }
...@@ -240,7 +230,8 @@ ...@@ -240,7 +230,8 @@
openSubMenu(event.target); openSubMenu(event.target);
// Check if child of .submenu-expand is touched // Check if child of .submenu-expand is touched
} else if ( null != getCurrentParent( event.target, '.submenu-expand' ) && getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) ) { } else if ( null != getCurrentParent( event.target, '.submenu-expand' ) &&
getCurrentParent( event.target, '.submenu-expand' ).matches( '.submenu-expand' ) ) {
openSubMenu( getCurrentParent( event.target, '.submenu-expand' ) ); openSubMenu( getCurrentParent( event.target, '.submenu-expand' ) );
// Check if .menu-item-link-return is touched // Check if .menu-item-link-return is touched
...@@ -264,6 +255,7 @@ ...@@ -264,6 +255,7 @@
if ( null != mainNav && hasClass( mainNav, '.main-navigation' ) ) { if ( null != mainNav && hasClass( mainNav, '.main-navigation' ) ) {
// Prevent default mouse events // Prevent default mouse events
event.preventDefault(); event.preventDefault();
} else if ( } else if (
event.target.matches('.submenu-expand') || event.target.matches('.submenu-expand') ||
null != getCurrentParent( event.target, '.submenu-expand' ) && null != getCurrentParent( event.target, '.submenu-expand' ) &&
......
=== Twenty Nineteen === === Twenty Nineteen ===
Contributors: the WordPress team Contributors: the WordPress team
Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready Tags: one-column, flexible-header, accessibility-ready, custom-colors, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, rtl-language-support, sticky-post, threaded-comments, translation-ready
Requires at least: 4.9.6 Requires at least: 4.9.6
Tested up to: WordPress 5.0 Tested up to: WordPress 5.0
Stable tag: 1.1 Stable tag: 1.2
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html License URI: http://www.gnu.org/licenses/gpl-2.0.html
...@@ -14,6 +14,11 @@ Our 2019 default theme is designed to show off the power of the block editor. It ...@@ -14,6 +14,11 @@ Our 2019 default theme is designed to show off the power of the block editor. It
== Changelog == == Changelog ==
= 1.2 =
* Released: January 9, 2019
https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.2
= 1.1 = = 1.1 =
* Released: December 19, 2018 * Released: December 19, 2018
......
...@@ -215,6 +215,9 @@ ...@@ -215,6 +215,9 @@
&.is-style-outline .wp-block-button__link:hover { &.is-style-outline .wp-block-button__link:hover {
color: white; color: white;
border-color: $color__background-button-hover; border-color: $color__background-button-hover;
&:not(.has-background) {
color: $color__background-button-hover;
}
} }
} }
...@@ -502,20 +505,40 @@ ...@@ -502,20 +505,40 @@
//! Image //! Image
.wp-block-image { .wp-block-image {
max-width: 100%;
img { img {
display: block; display: block;
} }
&.alignleft, .aligncenter {
&.alignright {
max-width: 100%; @include postContentMaxWidth();
@include media(tablet) {
margin: 0;
width: $size__site-tablet-content;
img {
margin: 0 auto;
}
}
@include media(desktop) {
width: $size__site-desktop-content;
img {
margin: 0 auto;
}
}
} }
&.alignfull img { &.alignfull img {
width: 100vw; width: 100vw;
max-width: calc( 100% + (2 * #{$size__spacing-unit}));
@include media(tablet) { @include media(tablet) {
max-width: calc( 125% + 150px );
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
......
...@@ -13,6 +13,39 @@ ...@@ -13,6 +13,39 @@
display: inline; display: inline;
} }
/* Un-style buttons */
button {
display: inline-block;
border: none;
padding: 0;
margin: 0;
font-family: $font__heading;
font-weight: 700;
line-height: $font__line-height-heading;
text-decoration: none;
background: transparent;
color: inherit;
cursor: pointer;
transition: background 250ms ease-in-out,
transform 150ms ease;
-webkit-appearance: none;
-moz-appearance: none;
&:hover,
&:focus {
background: transparent;
}
&:focus {
outline: 1px solid transparent;
outline-offset: -4px;
}
&:active {
transform: scale(0.99);
}
}
.main-menu { .main-menu {
display: inline-block; display: inline-block;
...@@ -169,6 +202,7 @@ ...@@ -169,6 +202,7 @@
color: $color__background-body; color: $color__background-body;
display: block; display: block;
line-height: $font__line-height-heading; line-height: $font__line-height-heading;
text-shadow: none;
padding: calc( .5 * #{$size__spacing-unit} ) calc( 24px + #{$size__spacing-unit} ) calc( .5 * #{$size__spacing-unit} ) $size__spacing-unit; padding: calc( .5 * #{$size__spacing-unit} ) calc( 24px + #{$size__spacing-unit} ) calc( .5 * #{$size__spacing-unit} ) $size__spacing-unit;
white-space: nowrap; white-space: nowrap;
...@@ -182,6 +216,13 @@ ...@@ -182,6 +216,13 @@
} }
} }
> .menu-item-link-return {
width: 100%;
font-size: $font__size_base;
font-weight: normal;
text-align: left;
}
> a:empty { > a:empty {
display: none; display: none;
} }
......
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
} }
} }
.main-navigation .sub-menu a {
opacity: inherit;
}
/* add focus state to social media icons */ /* add focus state to social media icons */
.social-navigation a { .social-navigation a {
&:focus { &:focus {
......
...@@ -200,6 +200,7 @@ ...@@ -200,6 +200,7 @@
&:after { &:after {
content: "\02192"; content: "\02192";