Skip to content

Commit 2e74c21

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents cdba6cb + 53e58eb commit 2e74c21

35 files changed

+3978
-276
lines changed

package-lock.json

Lines changed: 3407 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@
116116
"@wordpress/notices": "3.6.1",
117117
"@wordpress/nux": "5.4.5",
118118
"@wordpress/plugins": "4.4.3",
119-
"@wordpress/preferences": "1.2.5",
119+
"@wordpress/preferences": "2.8.0",
120+
"@wordpress/preferences-persistence": "1.8.0",
120121
"@wordpress/primitives": "3.4.1",
121122
"@wordpress/priority-queue": "2.6.1",
122123
"@wordpress/redux-routine": "4.6.1",

src/js/_enqueues/admin/common.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ window.screenMeta = {
617617
* @return {void}
618618
*/
619619
panel.slideDown( 'fast', function() {
620-
panel.trigger( 'focus' );
620+
panel.removeClass( 'hidden' ).trigger( 'focus' );
621621
button.addClass( 'screen-meta-active' ).attr( 'aria-expanded', true );
622622
});
623623

@@ -646,6 +646,7 @@ window.screenMeta = {
646646
button.removeClass( 'screen-meta-active' ).attr( 'aria-expanded', false );
647647
$('.screen-meta-toggle').css('visibility', '');
648648
panel.parent().hide();
649+
panel.addClass( 'hidden' );
649650
});
650651

651652
$document.trigger( 'screen:options:close' );

src/wp-admin/css/forms.css

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,12 @@ ul#add-to-blog-users {
776776

777777
.form-table p.timezone-info {
778778
margin: 1em 0;
779+
display: flex;
780+
flex-direction: column;
781+
}
782+
783+
#local-time {
784+
margin-top: 0.5em;
779785
}
780786

781787
.form-table td fieldset label {
@@ -1636,13 +1642,6 @@ table.form-table td .updated p {
16361642
display: block;
16371643
}
16381644

1639-
#utc-time,
1640-
#local-time {
1641-
display: block;
1642-
float: none;
1643-
margin-top: 0.5em;
1644-
}
1645-
16461645
.form-field #domain {
16471646
max-width: none;
16481647
}

src/wp-admin/menu.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,20 @@
214214
);
215215
}
216216

217+
if ( ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ) {
218+
$submenu['themes.php'][6] = array(
219+
__( 'Template Parts' ),
220+
'edit_theme_options',
221+
'site-editor.php?postType=wp_template_part',
222+
);
223+
}
224+
217225
$customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
218226

219227
// Hide Customize link on block themes unless a plugin or theme
220228
// is using 'customize_register' to add a setting.
221229
if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) {
222-
$position = wp_is_block_theme() ? 7 : 6;
230+
$position = ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) ? 7 : 6;
223231

224232
$submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
225233
}

src/wp-admin/site-editor.php

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@
1919
);
2020
}
2121

22-
if ( ! wp_is_block_theme() ) {
22+
if ( ! ( current_theme_supports( 'block-template-parts' ) || wp_is_block_theme() ) ) {
2323
wp_die( __( 'The theme you are currently using is not compatible with Full Site Editing.' ) );
2424
}
2525

26+
$is_template_part_editor = isset( $_GET['postType'] ) && 'wp_template_part' === sanitize_key( $_GET['postType'] );
27+
if ( ! wp_is_block_theme() && ! $is_template_part_editor ) {
28+
wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );
29+
}
30+
2631
/**
2732
* Do a server-side redirection if missing `postType` and `postId`
2833
* query args when visiting Site Editor.
@@ -64,14 +69,24 @@ static function( $classes ) {
6469

6570
$block_editor_context = new WP_Block_Editor_Context( array( 'name' => 'core/edit-site' ) );
6671
$custom_settings = array(
67-
'siteUrl' => site_url(),
68-
'postsPerPage' => get_option( 'posts_per_page' ),
69-
'styles' => get_block_editor_theme_styles(),
70-
'defaultTemplateTypes' => $indexed_template_types,
71-
'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(),
72-
'__unstableHomeTemplate' => $home_template,
72+
'siteUrl' => site_url(),
73+
'postsPerPage' => get_option( 'posts_per_page' ),
74+
'styles' => get_block_editor_theme_styles(),
75+
'defaultTemplateTypes' => $indexed_template_types,
76+
'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(),
77+
'supportsLayout' => WP_Theme_JSON_Resolver::theme_has_support(),
78+
'supportsTemplatePartsMode' => ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ),
79+
'__unstableHomeTemplate' => $home_template,
7380
);
7481

82+
/**
83+
* Home template resolution is not needed when block template parts are supported.
84+
* Set the value to `true` to satisfy the editor initialization guard clause.
85+
*/
86+
if ( $custom_settings['supportsTemplatePartsMode'] ) {
87+
$custom_settings['__unstableHomeTemplate'] = true;
88+
}
89+
7590
// Add additional back-compat patterns registered by `current_screen` et al.
7691
$custom_settings['__experimentalAdditionalBlockPatterns'] = WP_Block_Patterns_Registry::get_instance()->get_all_registered( true );
7792
$custom_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true );

src/wp-content/themes/twentynineteen/sass/elements/_elements.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ a:focus {
4040
outline: thin;
4141
outline-style: dotted;
4242
text-decoration: underline;
43+
text-decoration-thickness: 2px;
4344
}
4445

4546
h1,

src/wp-content/themes/twentynineteen/sass/navigation/_links.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ a {
1717
&:focus {
1818
outline: thin dotted;
1919
text-decoration: underline;
20+
text-decoration-thickness: 2px;
2021
}
2122
}

src/wp-content/themes/twentynineteen/sass/site/primary/_comments.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@
323323

324324
a {
325325
text-decoration: underline;
326+
text-decoration-thickness: 2px;
326327

327328
&:hover {
328329
text-decoration: none;

src/wp-content/themes/twentynineteen/sass/site/primary/_posts-and-pages.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212

213213
a {
214214
text-decoration: underline;
215+
text-decoration-thickness: 2px;
215216

216217
&.button,
217218
&:hover {

0 commit comments

Comments
 (0)