Skip to content

Commit 76c6b27

Browse files
authored
Merge branch 'WordPress:trunk' into wp_title-string-type
2 parents da236b1 + 4b4e950 commit 76c6b27

File tree

17 files changed

+358
-117
lines changed

17 files changed

+358
-117
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ module.exports = function(grunt) {
11591159
}
11601160

11611161
// Fetch a list of the files that Twemoji supplies.
1162-
query = 'query={repository(owner: "jdecked", name: "twemoji") {object(expression: "v17.0.1:assets/svg") {... on Tree {entries {name}}}}}';
1162+
query = 'query={repository(owner: "jdecked", name: "twemoji") {object(expression: "gh-pages:v/17.0.2/svg") {... on Tree {entries {name}}}}}';
11631163
files = spawn( 'gh', [ 'api', 'graphql', '-f', query] );
11641164

11651165
if ( 0 !== files.status ) {

src/js/_enqueues/vendor/twemoji.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ var twemoji = (function (
534534
how = {callback: how};
535535
}
536536

537-
// WP start
537+
// WP start
538538
// Allow passing of the doNotParse() callback in the settings.
539539
// The callback is used in `grabAllTextNodes()` (DOM mode only) as a filter
540540
// that allows bypassing of some of the text nodes. It gets the current subnode as argument.

src/wp-admin/includes/class-theme-installer-skin.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,24 @@ public function after() {
121121

122122
$install_actions = array();
123123

124-
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) && ! $theme_info->is_block_theme() ) {
125-
$customize_url = add_query_arg(
126-
array(
127-
'theme' => urlencode( $stylesheet ),
128-
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
129-
),
130-
admin_url( 'customize.php' )
131-
);
124+
if ( current_user_can( 'edit_theme_options' ) && ( $theme_info->is_block_theme() || current_user_can( 'customize' ) ) ) {
125+
if ( $theme_info->is_block_theme() ) {
126+
$customize_url = add_query_arg(
127+
array(
128+
'wp_theme_preview' => urlencode( $stylesheet ),
129+
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
130+
),
131+
admin_url( 'site-editor.php' )
132+
);
133+
} else {
134+
$customize_url = add_query_arg(
135+
array(
136+
'theme' => urlencode( $stylesheet ),
137+
'return' => urlencode( admin_url( 'web' === $this->type ? 'theme-install.php' : 'themes.php' ) ),
138+
),
139+
admin_url( 'customize.php' )
140+
);
141+
}
132142

133143
$install_actions['preview'] = sprintf(
134144
'<a href="%s" class="hide-if-no-customize load-customize">' .

src/wp-admin/includes/dashboard.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,7 @@ function wp_dashboard_recent_comments( $total_items = 5 ) {
10741074
$comments_query['status'] = 'approve';
10751075
}
10761076

1077+
$comments_count = 0;
10771078
do {
10781079
$possible = get_comments( $comments_query );
10791080

src/wp-admin/options-general.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -480,20 +480,11 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
480480

481481
foreach ( $date_formats as $format ) {
482482
echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
483-
484483
if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
485484
echo " checked='checked'";
486485
$custom = false;
487486
}
488-
489-
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
490-
'<code>' . esc_html( $format ) . '</code>';
491-
492-
if ( __( 'F j, Y' ) === $format ) {
493-
echo ' ' . __( '(Site language default)' );
494-
}
495-
496-
echo "</label><br />\n";
487+
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
497488
}
498489

499490
echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
@@ -534,20 +525,11 @@ class="<?php echo esc_attr( $classes_for_button ); ?>"
534525

535526
foreach ( $time_formats as $format ) {
536527
echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
537-
538528
if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "===".
539529
echo " checked='checked'";
540530
$custom = false;
541531
}
542-
543-
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span>' .
544-
'<code>' . esc_html( $format ) . '</code>';
545-
546-
if ( __( 'g:i a' ) === $format ) {
547-
echo ' ' . __( '(Site language default)' );
548-
}
549-
550-
echo "</label><br />\n";
532+
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
551533
}
552534

553535
echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';

src/wp-admin/themes.php

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@
645645
><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
646646

647647
<?php
648-
if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
648+
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
649649
/* translators: %s: Theme name. */
650650
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
651651
?>
@@ -1034,15 +1034,13 @@ function wp_theme_auto_update_setting_template() {
10341034
aria-label="<?php echo esc_attr( $aria_label ); ?>"
10351035
><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
10361036

1037-
<# if ( ! data.blockTheme ) { #>
1038-
<?php
1039-
/* translators: %s: Theme name. */
1040-
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
1041-
?>
1042-
<a class="button button-primary hide-if-no-customize disabled"
1043-
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
1044-
><?php _e( 'Live Preview' ); ?></a>
1045-
<# } #>
1037+
<?php
1038+
/* translators: %s: Theme name. */
1039+
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
1040+
?>
1041+
<a class="button button-primary hide-if-no-customize disabled"
1042+
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
1043+
><?php _e( 'Live Preview' ); ?></a>
10461044
<# } #>
10471045
<# } #>
10481046
</div>
@@ -1261,16 +1259,14 @@ function wp_theme_auto_update_setting_template() {
12611259

12621260
<div class="inactive-theme">
12631261
<# if ( data.compatibleWP && data.compatiblePHP ) { #>
1264-
<# if ( ! data.blockTheme ) { #>
1265-
<?php
1266-
/* translators: %s: Theme name. */
1267-
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
1268-
?>
1269-
<a class="button button-primary load-customize hide-if-no-customize"
1270-
href="{{{ data.actions.customize }}}"
1271-
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
1272-
><?php _e( 'Live Preview' ); ?></a>
1273-
<# } #>
1262+
<?php
1263+
/* translators: %s: Theme name. */
1264+
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
1265+
?>
1266+
<a class="button button-primary load-customize hide-if-no-customize"
1267+
href="{{{ data.actions.customize }}}"
1268+
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
1269+
><?php _e( 'Live Preview' ); ?></a>
12741270

12751271
<# if ( data.actions.activate ) { #>
12761272
<?php
@@ -1283,15 +1279,13 @@ function wp_theme_auto_update_setting_template() {
12831279
><?php _e( 'Activate' ); ?></a>
12841280
<# } #>
12851281
<# } else { #>
1286-
<# if ( ! data.blockTheme ) { #>
1287-
<?php
1288-
/* translators: %s: Theme name. */
1289-
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
1290-
?>
1291-
<a class="button button-primary hide-if-no-customize disabled"
1292-
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
1293-
><?php _e( 'Live Preview' ); ?></a>
1294-
<# } #>
1282+
<?php
1283+
/* translators: %s: Theme name. */
1284+
$live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
1285+
?>
1286+
<a class="button button-primary hide-if-no-customize disabled"
1287+
aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
1288+
><?php _e( 'Live Preview' ); ?></a>
12951289

12961290
<# if ( data.actions.activate ) { #>
12971291
<?php

src/wp-admin/widgets-form.php

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,12 @@
187187

188188
// Remove old position.
189189
if ( ! isset( $_POST['delete_widget'] ) ) {
190-
foreach ( $sidebars_widgets as $key => $sb ) {
191-
if ( is_array( $sb ) ) {
192-
$sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) );
190+
foreach ( $sidebars_widgets as $sidebar_id => $sidebar ) {
191+
if ( is_array( $sidebar ) ) {
192+
$sidebars_widgets[ $sidebar_id ] = array_diff( $sidebar, array( $widget_id ) );
193193
}
194194
}
195+
195196
array_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id );
196197
}
197198

@@ -235,11 +236,12 @@
235236
// Copy minimal info from an existing instance of this widget to a new instance.
236237
foreach ( $wp_registered_widget_controls as $control ) {
237238
if ( $_GET['base'] === $control['id_base'] ) {
238-
$control_callback = $control['callback'];
239-
$multi_number = (int) $_GET['num'];
240-
$control['params'][0]['number'] = -1;
241-
$control['id'] = $control['id_base'] . '-' . $multi_number;
242-
$widget_id = $control['id'];
239+
$control_callback = $control['callback'];
240+
$multi_number = (int) $_GET['num'];
241+
$control['params'][0]['number'] = -1;
242+
$control['id'] = $control['id_base'] . '-' . $multi_number;
243+
$widget_id = $control['id'];
244+
243245
$wp_registered_widget_controls[ $control['id'] ] = $control;
244246
break;
245247
}
@@ -299,31 +301,41 @@
299301
<div class="widget-position">
300302
<table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>
301303
<?php
302-
foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
303-
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
304-
if ( 'wp_inactive_widgets' === $sbname || str_starts_with( $sbname, 'orphaned_widgets' ) ) {
304+
foreach ( $wp_registered_sidebars as $sidebar_name => $sidebar_data ) {
305+
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sidebar_name ) . "'" .
306+
checked( $sidebar_name, $sidebar, false ) . " /> $sidebar_data[name]</label></td><td>";
307+
308+
if ( 'wp_inactive_widgets' === $sidebar_name || str_starts_with( $sidebar_name, 'orphaned_widgets' ) ) {
305309
echo '&nbsp;';
306310
} else {
307-
if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
308-
$j = 1;
309-
$sidebars_widgets[ $sbname ] = array();
311+
if ( ! isset( $sidebars_widgets[ $sidebar_name ] ) || ! is_array( $sidebars_widgets[ $sidebar_name ] ) ) {
312+
$widget_count = 1;
313+
314+
$sidebars_widgets[ $sidebar_name ] = array();
310315
} else {
311-
$j = count( $sidebars_widgets[ $sbname ] );
312-
if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
313-
++$j;
316+
$widget_count = count( $sidebars_widgets[ $sidebar_name ] );
317+
318+
if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sidebar_name ], true ) ) {
319+
++$widget_count;
314320
}
315321
}
322+
316323
$selected = '';
317-
echo "\t\t<select name='{$sbname}_position'>\n";
324+
325+
echo "\t\t<select name='{$sidebar_name}_position'>\n";
318326
echo "\t\t<option value=''>" . __( '&mdash; Select &mdash;' ) . "</option>\n";
319-
for ( $i = 1; $i <= $j; $i++ ) {
320-
if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
327+
328+
for ( $i = 1; $i <= $widget_count; $i++ ) {
329+
if ( in_array( $widget_id, $sidebars_widgets[ $sidebar_name ], true ) ) {
321330
$selected = selected( $i, $key + 1, false );
322331
}
332+
323333
echo "\t\t<option value='$i'$selected> $i </option>\n";
324334
}
335+
325336
echo "\t\t</select>\n";
326337
}
338+
327339
echo "</td></tr>\n";
328340
}
329341
?>
@@ -512,7 +524,7 @@
512524
</div>
513525
<?php
514526

515-
$i = 0;
527+
$sidebar_index = 0;
516528
$split = 0;
517529
$single_sidebar_class = '';
518530
$sidebars_count = count( $theme_sidebars );
@@ -535,11 +547,11 @@
535547
$wrap_class .= ' sidebar-' . $registered_sidebar['class'];
536548
}
537549

538-
if ( $i > 0 ) {
550+
if ( $sidebar_index > 0 ) {
539551
$wrap_class .= ' closed';
540552
}
541553

542-
if ( $split && $i === $split ) {
554+
if ( $split && $sidebar_index === $split ) {
543555
?>
544556
</div><div class="sidebars-column-2">
545557
<?php
@@ -554,7 +566,7 @@
554566
</div>
555567
<?php
556568

557-
++$i;
569+
++$sidebar_index;
558570
}
559571

560572
?>

src/wp-content/themes/twentytwenty/assets/css/editor-style-block-rtl.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,10 @@ hr.wp-block-separator.is-style-dots::before {
10641064
margin-top: 15px;
10651065
}
10661066

1067+
.wp-block-latest-posts__post-full-content p {
1068+
font-family: inherit;
1069+
}
1070+
10671071
.wp-block-latest-posts__post-full-content > p:first-child {
10681072
margin-top: 1em;
10691073
}

src/wp-content/themes/twentytwenty/assets/css/editor-style-block.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,10 @@ hr.wp-block-separator.is-style-dots::before {
10681068
margin-top: 15px;
10691069
}
10701070

1071+
.wp-block-latest-posts__post-full-content p {
1072+
font-family: inherit;
1073+
}
1074+
10711075
.wp-block-latest-posts__post-full-content > p:first-child {
10721076
margin-top: 1em;
10731077
}

src/wp-includes/class-wp-date-query.php

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -482,17 +482,25 @@ public function validate_column( $column ) {
482482
global $wpdb;
483483

484484
$valid_columns = array(
485-
'post_date',
486-
'post_date_gmt',
487-
'post_modified',
488-
'post_modified_gmt',
489-
'comment_date',
490-
'comment_date_gmt',
491-
'user_registered',
492-
'registered',
493-
'last_updated',
485+
'post_date', // Part of $wpdb->posts.
486+
'post_date_gmt', // Part of $wpdb->posts.
487+
'post_modified', // Part of $wpdb->posts.
488+
'post_modified_gmt', // Part of $wpdb->posts.
489+
'comment_date', // Part of $wpdb->comments.
490+
'comment_date_gmt', // Part of $wpdb->comments.
491+
'user_registered', // Part of $wpdb->users.
494492
);
495493

494+
if ( is_multisite() ) {
495+
$valid_columns = array_merge(
496+
$valid_columns,
497+
array(
498+
'registered', // Part of $wpdb->blogs.
499+
'last_updated', // Part of $wpdb->blogs.
500+
)
501+
);
502+
}
503+
496504
// Attempt to detect a table prefix.
497505
if ( ! str_contains( $column, '.' ) ) {
498506
/**
@@ -525,11 +533,14 @@ public function validate_column( $column ) {
525533
$wpdb->users => array(
526534
'user_registered',
527535
),
528-
$wpdb->blogs => array(
536+
);
537+
538+
if ( is_multisite() ) {
539+
$known_columns[ $wpdb->blogs ] = array(
529540
'registered',
530541
'last_updated',
531-
),
532-
);
542+
);
543+
}
533544

534545
// If it's a known column name, add the appropriate table prefix.
535546
foreach ( $known_columns as $table_name => $table_columns ) {

0 commit comments

Comments
 (0)