Skip to content

Commit 129b18e

Browse files
Merge branch 'trunk' into refine/notes-notifications
2 parents cdf5068 + 328ab83 commit 129b18e

File tree

12 files changed

+373
-48
lines changed

12 files changed

+373
-48
lines changed

Gruntfile.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,9 +1785,6 @@ module.exports = function(grunt) {
17851785
const ignoredFiles = [
17861786
'build/wp-includes/js/dist/components.js',
17871787
'build/wp-includes/js/dist/data.js',
1788-
// We have a problem where Yjs is being bundled in core-data.
1789-
// Ignoring this file until we find a solution.
1790-
'build/wp-includes/js/dist/core-data.js',
17911788
];
17921789
const files = buildFiles.reduce( ( acc, path ) => {
17931790
// Skip excluded paths and any path that isn't a file.

src/wp-admin/includes/class-wp-comments-list-table.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ public function prepare_items() {
9999
$comment_status = 'all';
100100
}
101101

102-
$comment_type = ! empty( $_REQUEST['comment_type'] ) ? $_REQUEST['comment_type'] : '';
102+
$comment_type = '';
103+
104+
if ( ! empty( $_REQUEST['comment_type'] ) && 'note' !== $_REQUEST['comment_type'] ) {
105+
$comment_type = $_REQUEST['comment_type'];
106+
}
103107

104108
$search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : '';
105109

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-theme-json.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3250,7 +3250,11 @@ public function merge( $incoming ) {
32503250
foreach ( static::PRESETS_METADATA as $preset_metadata ) {
32513251
$prevent_override = $preset_metadata['prevent_override'];
32523252
if ( is_array( $prevent_override ) ) {
3253-
$prevent_override = _wp_array_get( $this->theme_json['settings'], $preset_metadata['prevent_override'] );
3253+
$global_path = array_merge( array( 'settings' ), $prevent_override );
3254+
$global_value = _wp_array_get( $this->theme_json, $global_path, null );
3255+
3256+
$node_level_path = array_merge( $node['path'], $prevent_override );
3257+
$prevent_override = _wp_array_get( $this->theme_json, $node_level_path, $global_value );
32543258
}
32553259

32563260
foreach ( static::VALID_ORIGINS as $origin ) {

src/wp-includes/pluggable.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,13 @@ function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) {
10471047

10481048
if ( ! function_exists( 'wp_set_auth_cookie' ) ) :
10491049
/**
1050-
* Sets the authentication cookies based on user ID.
1050+
* Sets the authentication cookies for a given user ID.
10511051
*
1052-
* The $remember parameter increases the time that the cookie will be kept. The
1053-
* default the cookie is kept without remembering is two days. When $remember is
1054-
* set, the cookies will be kept for 14 days or two weeks.
1052+
* The `$remember` parameter controls cookie persistence:
1053+
* - If true, the cookie is persistent (default 14 days, filterable via {@see 'auth_cookie_expiration'}).
1054+
* - If false, the cookie is a browser session cookie (expires when the browser closes).
1055+
* Internally, {@see 'auth_cookie_expiration'} is still applied, to expire the login after
1056+
* two days or when the browser is closed, whichever occurs first.
10551057
*
10561058
* @since 2.5.0
10571059
* @since 4.3.0 Added the `$token` parameter.

src/wp-includes/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '6.9-beta3-61129-src';
19+
$wp_version = '6.9-beta4-61182-src';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

tests/phpunit/tests/admin/wpCommentsListTable.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,35 @@ public function test_get_views_should_return_views_by_default() {
213213
);
214214
$this->assertSame( $expected, $this->table->get_views() );
215215
}
216+
217+
/**
218+
* Verify that the comments table never shows the note comment_type.
219+
*
220+
* @ticket 64198
221+
*/
222+
public function test_comments_list_table_does_not_show_note_comment_type() {
223+
$post_id = self::factory()->post->create();
224+
$note_id = self::factory()->comment->create(
225+
array(
226+
'comment_post_ID' => $post_id,
227+
'comment_content' => 'This is a note.',
228+
'comment_type' => 'note',
229+
'comment_approved' => '1',
230+
)
231+
);
232+
$comment_id = self::factory()->comment->create(
233+
array(
234+
'comment_post_ID' => $post_id,
235+
'comment_content' => 'This is a regular comment.',
236+
'comment_type' => '',
237+
'comment_approved' => '1',
238+
)
239+
);
240+
// Request the note comment type.
241+
$_REQUEST['comment_type'] = 'note';
242+
$this->table->prepare_items();
243+
$items = $this->table->items;
244+
$this->assertCount( 1, $items );
245+
$this->assertEquals( $comment_id, $items[0]->comment_ID );
246+
}
216247
}

tests/phpunit/tests/blocks/wpBlockStylesRegistry.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* @since 6.6.0
88
*
99
* @group blocks
10+
* @coversDefaultClass WP_Block_Styles_Registry
1011
*/
1112
class Tests_Blocks_wpBlockStylesRegistry extends WP_UnitTestCase {
1213

@@ -67,6 +68,63 @@ public function test_register_block_style_with_array_of_block_names() {
6768
$this->assertTrue( $this->registry->is_registered( 'core/group', 'plain' ) );
6869
}
6970

71+
/**
72+
* Should accept valid string style label. The registered style should have the same label.
73+
*
74+
* @ticket 52592
75+
*
76+
* @covers ::register
77+
* @covers ::is_registered
78+
* @covers ::get_registered_styles_for_block
79+
*/
80+
public function test_register_block_style_with_label() {
81+
$name = 'core/paragraph';
82+
$style_properties = array(
83+
'name' => 'fancy',
84+
'label' => 'Fancy',
85+
);
86+
$result = $this->registry->register( $name, $style_properties );
87+
88+
$this->assertTrue( $result, 'The block style should be registered when the label is a valid string.' );
89+
$this->assertTrue(
90+
$this->registry->is_registered( $name, 'fancy' ),
91+
'The block type should have the block style registered when the label is valid.'
92+
);
93+
$this->assertSame(
94+
$style_properties['label'],
95+
$this->registry->get_registered_styles_for_block( $name )['fancy']['label'],
96+
'The registered block style should have the same label.'
97+
);
98+
}
99+
100+
/**
101+
* Should register the block style when `label` is missing, using `name` as the label.
102+
*
103+
* @ticket 52592
104+
*
105+
* @covers ::register
106+
* @covers ::is_registered
107+
* @covers ::get_registered_styles_for_block
108+
*/
109+
public function test_register_block_style_without_label() {
110+
$name = 'core/paragraph';
111+
$style_properties = array(
112+
'name' => 'fancy',
113+
);
114+
$result = $this->registry->register( $name, $style_properties );
115+
116+
$this->assertTrue( $result, 'The block style should be registered when the label is missing.' );
117+
$this->assertTrue(
118+
$this->registry->is_registered( $name, 'fancy' ),
119+
'The block type should have the block style registered when the label is missing.'
120+
);
121+
$this->assertSame(
122+
$style_properties['name'],
123+
$this->registry->get_registered_styles_for_block( $name )['fancy']['label'],
124+
'The registered block style label should be the same as the name.'
125+
);
126+
}
127+
70128
/**
71129
* @ticket 63957
72130
*/

0 commit comments

Comments
 (0)