Skip to content

Commit f2c819e

Browse files
Merge branch 'trunk' into fix/tooltip-captures-click
2 parents 93e81f5 + e0a171a commit f2c819e

328 files changed

Lines changed: 1907 additions & 1043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backport-changelog/7.0/11566.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
https://github.com/WordPress/wordpress-develop/pull/11566
22

33
* https://github.com/WordPress/gutenberg/pull/76939
4+
* https://github.com/WordPress/gutenberg/pull/77361

changelog.txt

Lines changed: 326 additions & 0 deletions
Large diffs are not rendered by default.

docs/reference-guides/core-blocks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ Content for a tab in a tabbed interface. ([Source](https://github.com/WordPress/
996996
- **Experimental:** true
997997
- **Category:** design
998998
- **Parent:** core/tab-panel
999-
- **Supports:** anchor, color (background, text), layout, renaming, spacing (blockGap, padding, ~~margin~~), typography (fontSize), ~~html~~, ~~reusable~~
999+
- **Supports:** anchor, color (background, text), layout, renaming, spacing (blockGap, padding, ~~margin~~), typography (fontSize), ~~html~~, ~~reusable~~, ~~visibility~~
10001000
- **Attributes:** label
10011001

10021002
## Tab Panel
@@ -1008,7 +1008,7 @@ Container for tab panel content in a tabbed interface. ([Source](https://github.
10081008
- **Category:** design
10091009
- **Parent:** core/tabs
10101010
- **Allowed Blocks:** core/tab
1011-
- **Supports:** color (background, heading, link, text), dimensions (~~aspectRatio~~, ~~height~~, ~~minHeight~~, ~~width~~), layout (allowJustification, default, ~~allowOrientation~~, ~~allowSizingOnChildren~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (margin, padding, ~~blockGap~~), typography (fontSize), ~~anchor~~, ~~html~~, ~~lock~~, ~~reusable~~
1011+
- **Supports:** color (background, heading, link, text), dimensions (~~aspectRatio~~, ~~height~~, ~~minHeight~~, ~~width~~), layout (allowJustification, default, ~~allowOrientation~~, ~~allowSizingOnChildren~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~), spacing (margin, padding, ~~blockGap~~), typography (fontSize), ~~anchor~~, ~~html~~, ~~lock~~, ~~reusable~~, ~~visibility~~
10121012

10131013
## Table
10141014

@@ -1049,7 +1049,7 @@ Display the tab buttons for a tabbed interface. ([Source](https://github.com/Wor
10491049
- **Category:** design
10501050
- **Parent:** core/tabs
10511051
- **Allowed Blocks:** core/tabs-menu-item
1052-
- **Supports:** color (background, text), dimensions (~~aspectRatio~~, ~~height~~, ~~minHeight~~, ~~width~~), layout (allowJustification, allowOrientation, allowVerticalAlignment, default, ~~allowSwitching~~), spacing (blockGap, margin, padding), typography (fontSize), ~~html~~, ~~lock~~, ~~reusable~~
1052+
- **Supports:** color (background, text), dimensions (~~aspectRatio~~, ~~height~~, ~~minHeight~~, ~~width~~), layout (allowJustification, allowOrientation, allowVerticalAlignment, default, ~~allowSwitching~~), spacing (blockGap, margin, padding), typography (fontSize), ~~html~~, ~~lock~~, ~~reusable~~, ~~visibility~~
10531053

10541054
## Tab Menu Item
10551055

@@ -1059,7 +1059,7 @@ A single tab button in the tabs menu. ([Source](https://github.com/WordPress/gut
10591059
- **Experimental:** true
10601060
- **Category:** design
10611061
- **Parent:** core/tabs-menu
1062-
- **Supports:** color (background, text), layout (~~allowEditing~~), spacing (padding), typography (fontSize, textAlign), ~~html~~, ~~lock~~, ~~reusable~~
1062+
- **Supports:** color (background, text), layout (~~allowEditing~~), spacing (padding), typography (fontSize, textAlign), ~~html~~, ~~lock~~, ~~reusable~~, ~~visibility~~
10631063

10641064
## Tag Cloud
10651065

docs/reference-guides/data/data-core-edit-post.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,6 @@ _Returns_
124124

125125
- `Object`: Preferences Object.
126126

127-
### getRtcCompatibleMetaBoxIds
128-
129-
Returns the list of meta box IDs marked as compatible with real-time collaboration via the add_meta_box() \_\_rtc_compatible_meta_box compatibility flag.
130-
131-
_Parameters_
132-
133-
- _state_ `Object`: Global application state.
134-
135-
_Returns_
136-
137-
- `string[]`: List of RTC-compatible meta box IDs.
138-
139127
### hasMetaBoxes
140128

141129
Returns true if the post is using Meta Boxes
@@ -484,14 +472,6 @@ _Parameters_
484472

485473
- _isOpen_ `boolean`: A boolean representing whether the list view should be opened or closed.
486474

487-
### setRtcCompatibleMetaBoxIds
488-
489-
Stores the IDs of meta boxes marked as compatible with real-time collaboration via the \_\_rtc_compatible_meta_box flag on the server.
490-
491-
_Parameters_
492-
493-
- _ids_ `string[]`: Meta box IDs that are RTC-compatible.
494-
495475
### showBlockTypes
496476

497477
Update the provided block types to be visible.

gutenberg.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
66
* Requires at least: 6.8
77
* Requires PHP: 7.4
8-
* Version: 22.9.0
8+
* Version: 23.0.0-rc.1
99
* Author: Gutenberg Team
1010
* Text Domain: gutenberg
1111
*

lib/compat/wordpress-7.0/meta-box-rtc-compat.php

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,77 @@
1010
* @package gutenberg
1111
*/
1212

13-
if ( ! function_exists( 'gutenberg_inject_rtc_compatible_meta_boxes' ) ) {
14-
/**
15-
* Reads the __rtc_compatible_meta_box flag from registered meta boxes
16-
* and injects the compatibility data into the block editor via inline script.
17-
*
18-
* Hooks into filter_block_editor_meta_boxes at a late priority so that it
19-
* runs after any developer filters that add the flag to third-party meta boxes.
20-
*
21-
* @param array $wp_meta_boxes Global meta box state.
22-
* @return array Unmodified meta box state.
23-
*/
24-
function gutenberg_inject_rtc_compatible_meta_boxes( $wp_meta_boxes ) {
25-
global $current_screen;
13+
/**
14+
* Reads the __rtc_compatible_meta_box flag from registered meta boxes
15+
* and injects the compatibility data into the block editor via inline script.
16+
*
17+
* Hooks into filter_block_editor_meta_boxes at a late priority so that it
18+
* runs after any developer filters that add the flag to third-party meta boxes.
19+
*
20+
* @param array $wp_meta_boxes Global meta box state.
21+
* @return array Unmodified meta box state.
22+
*/
23+
function gutenberg_inject_rtc_compatible_meta_boxes( $wp_meta_boxes ) {
24+
global $current_screen;
2625

27-
if ( ! $current_screen || ! wp_is_collaboration_enabled() ) {
28-
return $wp_meta_boxes;
29-
}
26+
if ( ! $current_screen || ! wp_is_collaboration_enabled() ) {
27+
return $wp_meta_boxes;
28+
}
3029

31-
$screen_id = $current_screen->id;
30+
$screen_id = $current_screen->id;
3231

33-
if ( ! isset( $wp_meta_boxes[ $screen_id ] ) ) {
34-
return $wp_meta_boxes;
35-
}
32+
if ( ! isset( $wp_meta_boxes[ $screen_id ] ) ) {
33+
return $wp_meta_boxes;
34+
}
3635

37-
$rtc_compatible_ids = array();
36+
$meta_boxes_per_location = array();
3837

39-
foreach ( $wp_meta_boxes[ $screen_id ] as $priorities ) {
40-
foreach ( $priorities as $priority_boxes ) {
41-
foreach ( (array) $priority_boxes as $meta_box ) {
42-
if ( false === $meta_box || ! $meta_box['title'] ) {
43-
continue;
44-
}
38+
foreach ( $wp_meta_boxes[ $screen_id ] as $location => $priorities ) {
39+
foreach ( $priorities as $priority_boxes ) {
40+
foreach ( (array) $priority_boxes as $meta_box ) {
41+
if ( false === $meta_box || ! $meta_box['title'] ) {
42+
continue;
43+
}
4544

46-
if ( isset( $meta_box['args']['__rtc_compatible_meta_box'] )
47-
&& $meta_box['args']['__rtc_compatible_meta_box'] ) {
48-
$rtc_compatible_ids[] = $meta_box['id'];
49-
}
45+
if ( empty( $meta_box['args']['__rtc_compatible_meta_box'] ) ) {
46+
continue;
5047
}
48+
49+
if ( ! isset( $meta_boxes_per_location[ $location ] ) ) {
50+
$meta_boxes_per_location[ $location ] = array();
51+
}
52+
53+
$meta_boxes_per_location[ $location ][] = array(
54+
'id' => $meta_box['id'],
55+
'title' => $meta_box['title'],
56+
'__rtc_compatible' => true,
57+
);
5158
}
5259
}
60+
}
5361

54-
if ( ! empty( $rtc_compatible_ids ) ) {
55-
// Meta boxes are registered during admin_head, which fires after
56-
// admin_enqueue_scripts where the editor instance is created. This
57-
// means the compatibility data cannot be added to editor settings
58-
// directly. Instead, we inject an inline script that dispatches
59-
// into the store once the block editor has finished loading.
60-
$script = 'window._wpLoadBlockEditor.then( function() {
61-
wp.data.dispatch( \'core/edit-post\' ).setRtcCompatibleMetaBoxIds( '
62-
. wp_json_encode( array_values( array_unique( $rtc_compatible_ids ) ) )
63-
. ' );
64-
} );';
62+
if ( ! empty( $meta_boxes_per_location ) ) {
63+
// Meta boxes are registered during admin_head, which fires after
64+
// admin_enqueue_scripts where the editor instance is created. This
65+
// means the compatibility data cannot be added to editor settings
66+
// directly. Instead, we inject an inline script that dispatches
67+
// into the store once the block editor has finished loading. The
68+
// existing entries are merged by id, so this re-flags meta boxes
69+
// already registered by WordPress core.
70+
$script = 'window._wpLoadBlockEditor.then( function() {
71+
wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ' );
72+
} );';
6573

66-
wp_add_inline_script( 'wp-edit-post', $script );
74+
wp_add_inline_script( 'wp-edit-post', $script );
6775

68-
// If wp-edit-post is output earlier in <head>, the inline script
69-
// needs to be manually printed. This mirrors the same fallback
70-
// used by WordPress core for setAvailableMetaBoxesPerLocation.
71-
if ( wp_script_is( 'wp-edit-post', 'done' ) ) {
72-
printf( "<script>\n%s\n</script>\n", trim( $script ) );
73-
}
76+
// If wp-edit-post is output earlier in <head>, the inline script
77+
// needs to be manually printed. This mirrors the same fallback
78+
// used by WordPress core for setAvailableMetaBoxesPerLocation.
79+
if ( wp_script_is( 'wp-edit-post', 'done' ) ) {
80+
printf( "<script>\n%s\n</script>\n", trim( $script ) );
7481
}
75-
76-
return $wp_meta_boxes;
7782
}
7883

79-
add_filter( 'filter_block_editor_meta_boxes', 'gutenberg_inject_rtc_compatible_meta_boxes', 100 );
84+
return $wp_meta_boxes;
8085
}
86+
add_filter( 'filter_block_editor_meta_boxes', 'gutenberg_inject_rtc_compatible_meta_boxes', 100 );

0 commit comments

Comments
 (0)