Skip to content

Commit

Permalink
Merge pull request azureappserviceoss#64 from LeonZhang77/503
Browse files Browse the repository at this point in the history
New Version of Wordpress, version is 5.0.3.
  • Loading branch information
LeonZhang77 authored Jan 17, 2019
2 parents edba733 + 6e1e093 commit bf95111
Show file tree
Hide file tree
Showing 78 changed files with 1,308 additions and 593 deletions.
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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
it under the terms of the GNU General Public License as published by
Expand Down
20 changes: 19 additions & 1 deletion wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,25 @@
<p>
<?php
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(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
Expand Down
4 changes: 4 additions & 0 deletions wp-admin/css/common-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ code {
margin: 10px 2px 0 20px;
}

.wrap.block-editor-no-js {
padding-right: 20px;
}

.wrap > h2:first-child, /* 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 */
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/common-rtl.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions wp-admin/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,10 @@ code {
margin: 10px 20px 0 2px;
}

.wrap.block-editor-no-js {
padding-left: 20px;
}

.wrap > h2:first-child, /* 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 */
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/common.min.css

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
*/
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.
$current_screen = get_current_screen();
$current_screen->is_block_editor( true );
Expand Down Expand Up @@ -399,9 +395,36 @@
?>

<div class="block-editor">
<h1 class="screen-reader-text"><?php echo esc_html( $post_type_object->labels->edit_item ); ?></h1>
<div id="editor" class="block-editor__container"></div>
<h1 class="screen-reader-text hide-if-no-js"><?php echo esc_html( $title ); ?></h1>
<div id="editor" class="block-editor__container hide-if-no-js"></div>
<div id="metaboxes" class="hidden">
<?php the_block_editor_meta_boxes(); ?>
</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>
5 changes: 3 additions & 2 deletions wp-admin/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
$post_new_file = "post-new.php?post_type=$post_type";
}

$title = $post_type_object->labels->edit_item;

/**
* Allows replacement of the editor.
*
Expand All @@ -174,8 +176,7 @@
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') ) {
wp_enqueue_script('admin-comments');
Expand Down
6 changes: 3 additions & 3 deletions wp-content/themes/twentynineteen/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ 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(), '1.0', true );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.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.1', true );
}

wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );
Expand Down Expand Up @@ -257,7 +257,7 @@ function twentynineteen_skip_link_focus_fix() {
*/
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' ) ) {
// Include color patterns.
Expand Down
4 changes: 2 additions & 2 deletions wp-content/themes/twentynineteen/inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ 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' ), '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' );

/**
* 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(), '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' );

Expand Down
22 changes: 11 additions & 11 deletions wp-content/themes/twentynineteen/inc/template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,18 +203,18 @@ function twentynineteen_add_ellipses_to_nav( $nav_menu, $args ) {
if ( 'menu-1' === $args->theme_location ) :

$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 .= '<a href="#" class="screen-reader-text" aria-label="More" aria-haspopup="true" aria-expanded="false">' . esc_html__( 'More', 'twentynineteen' ) . '</a>';
$nav_menu .= '<span class="submenu-expand main-menu-more-toggle is-empty" tabindex="-1">';
$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="screen-reader-text">' . esc_html__( 'More', 'twentynineteen' ) . '</span>';
$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 .= '<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 .= esc_html__( 'Back', 'twentynineteen' );
$nav_menu .= '</span>';
$nav_menu .= '</button>';
$nav_menu .= '</li>';
$nav_menu .= '</ul>';
$nav_menu .= '</li>';
Expand Down Expand Up @@ -269,22 +269,22 @@ 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.
// @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(
'<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 )
);

// replace opening <a> with <span>
// replace opening <a> with <button>
$output = preg_replace(
'/<a\s.*?>/',
$link,
$output,
1 // Limit.
);

// replace closing </a> with </span>
// replace closing </a> with </button>
$output = preg_replace(
'#</a>#i',
'</span>',
'</button>',
$output,
1 // Limit.
);
Expand All @@ -295,7 +295,7 @@ function twentynineteen_add_dropdown_icons( $output, $item, $depth, $args ) {
$icon = twentynineteen_get_icon_svg( 'keyboard_arrow_down', 24 );

$output .= sprintf(
'<span class="submenu-expand" tabindex="-1">%s</span>',
'<button class="submenu-expand" tabindex="-1">%s</button>',
$icon
);
}
Expand Down
18 changes: 5 additions & 13 deletions wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
currentSubMenu.parentElement.lastElementChild.className += ' expanded-true';

// Update aria-expanded state
toggleAriaExpandedState( currentSubMenu.previousSibling );
toggleAriaExpandedState( currentSubMenu );
}

/**
Expand Down Expand Up @@ -219,19 +219,9 @@

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 #
} else if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) {

if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) {
openSubMenu( event.target );

// Prevent default touch events
} else {

event.preventDefault();
}
}

Expand All @@ -240,7 +230,8 @@
openSubMenu(event.target);

// 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' ) );

// Check if .menu-item-link-return is touched
Expand All @@ -264,6 +255,7 @@
if ( null != mainNav && hasClass( mainNav, '.main-navigation' ) ) {
// Prevent default mouse events
event.preventDefault();

} else if (
event.target.matches('.submenu-expand') ||
null != getCurrentParent( event.target, '.submenu-expand' ) &&
Expand Down
9 changes: 7 additions & 2 deletions wp-content/themes/twentynineteen/readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Twenty Nineteen ===
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
Tested up to: WordPress 5.0
Stable tag: 1.1
Stable tag: 1.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -14,6 +14,11 @@ Our 2019 default theme is designed to show off the power of the block editor. It

== Changelog ==

= 1.2 =
* Released: January 9, 2019

https://codex.wordpress.org/Twenty_Nineteen_Theme_Changelog#Version_1.2

= 1.1 =
* Released: December 19, 2018

Expand Down
29 changes: 26 additions & 3 deletions wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@
&.is-style-outline .wp-block-button__link:hover {
color: white;
border-color: $color__background-button-hover;
&:not(.has-background) {
color: $color__background-button-hover;
}
}
}

Expand Down Expand Up @@ -502,20 +505,40 @@

//! Image
.wp-block-image {
max-width: 100%;

img {
display: block;
}

&.alignleft,
&.alignright {
max-width: 100%;
.aligncenter {

@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 {
width: 100vw;
max-width: calc( 100% + (2 * #{$size__spacing-unit}));

@include media(tablet) {
max-width: calc( 125% + 150px );
margin-left: auto;
margin-right: auto;
}
Expand Down
Loading

0 comments on commit bf95111

Please sign in to comment.