Skip to content

Commit 3cd5e40

Browse files
committed
prep build 10/16
2 parents a8bbee0 + 27aed30 commit 3cd5e40

File tree

52 files changed

+527
-356
lines changed

Some content is hidden

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

52 files changed

+527
-356
lines changed

backport-changelog/6.7/7552.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7552
2+
3+
* https://github.com/WordPress/gutenberg/pull/66058

backport-changelog/6.7/7561.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7561
2+
3+
* https://github.com/WordPress/gutenberg/pull/66084

backport-changelog/6.8/7575.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
https://github.com/WordPress/wordpress-develop/pull/7575
2+
3+
* https://github.com/WordPress/gutenberg/pull/66154

docs/how-to-guides/data-basics/3-building-an-edit-form.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,5 +539,5 @@ function EditPageForm( { pageId, onCancel, onSaveFinished } ) {
539539
## What's next?
540540
541541
* **Previous part:** [Building a list of pages](/docs/how-to-guides/data-basics/2-building-a-list-of-pages.md)
542-
* **Next part:** Building a *New Page* form (coming soon)
542+
* **Next part:** [Building a Create Page form](/docs/how-to-guides/data-basics/4-building-a-create-page-form.md)
543543
* (optional) Review the [finished app](https://github.com/WordPress/block-development-examples/tree/trunk/plugins/data-basics-59c8f8) in the block-development-examples repository

docs/how-to-guides/data-basics/4-building-a-create-page-form.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Part 4: Building a Create page form
1+
# Building a Create page form
22

33
In the [previous part](/docs/how-to-guides/data-basics/3-building-an-edit-form.md) we created an *Edit page* feature, and in this part we will add a *Create page* feature. Here's a glimpse of what we're going to build:
44

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
"parent": "data-basics"
199199
},
200200
{
201-
"title": "Part 4: Building a Create page form",
201+
"title": "Building a Create page form",
202202
"slug": "4-building-a-create-page-form",
203203
"markdown_source": "../docs/how-to-guides/data-basics/4-building-a-create-page-form.md",
204204
"parent": "data-basics"

lib/class-wp-theme-json-gutenberg.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,17 +2732,13 @@ private static function update_separator_declarations( $declarations ) {
27322732
* @return array The block nodes in theme.json.
27332733
*/
27342734
private static function get_block_nodes( $theme_json, $selectors = array(), $options = array() ) {
2735-
$selectors = empty( $selectors ) ? static::get_blocks_metadata() : $selectors;
2736-
$nodes = array();
2737-
if ( ! isset( $theme_json['styles'] ) ) {
2738-
return $nodes;
2739-
}
2735+
$nodes = array();
27402736

2741-
// Blocks.
27422737
if ( ! isset( $theme_json['styles']['blocks'] ) ) {
27432738
return $nodes;
27442739
}
27452740

2741+
$selectors = empty( $selectors ) ? static::get_blocks_metadata() : $selectors;
27462742
$include_variations = $options['include_block_style_variations'] ?? false;
27472743
$include_node_paths_only = $options['include_node_paths_only'] ?? false;
27482744

lib/client-assets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ function gutenberg_default_script_modules() {
630630
switch ( $script_module_id ) {
631631
/*
632632
* Interactivity exposes two entrypoints, "/index" and "/debug".
633-
* "/debug" should replalce "/index" in devlopment.
633+
* "/debug" should replace "/index" in development.
634634
*/
635635
case '@wordpress/interactivity/debug':
636636
if ( ! SCRIPT_DEBUG ) {

lib/compat/wordpress-6.7/block-bindings.php

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,28 @@
66
*/
77

88
/**
9-
* Adds the block bindings sources registered in the server to the editor settings.
10-
*
11-
* This allows them to be bootstrapped in the editor.
12-
*
13-
* @param array $settings The block editor settings from the `block_editor_settings_all` filter.
14-
* @return array The editor settings including the block bindings sources.
9+
* Bootstrap the block bindings sources registered in the server.
1510
*/
16-
function gutenberg_add_server_block_bindings_sources_to_editor_settings( $editor_settings ) {
17-
// Check if the sources are already exposed in the editor settings.
18-
if ( isset( $editor_settings['blockBindingsSources'] ) ) {
19-
return $editor_settings;
20-
}
21-
22-
$registered_block_bindings_sources = get_all_registered_block_bindings_sources();
23-
if ( ! empty( $registered_block_bindings_sources ) ) {
24-
// Initialize array.
25-
$editor_settings['blockBindingsSources'] = array();
26-
foreach ( $registered_block_bindings_sources as $source_name => $source_properties ) {
27-
// Add source with the label to editor settings.
28-
$editor_settings['blockBindingsSources'][ $source_name ] = array(
29-
'label' => $source_properties->label,
11+
function gutenberg_bootstrap_server_block_bindings_sources() {
12+
$registered_sources = get_all_registered_block_bindings_sources();
13+
if ( ! empty( $registered_sources ) ) {
14+
$filtered_sources = array();
15+
foreach ( $registered_sources as $source ) {
16+
$filtered_sources[] = array(
17+
'name' => $source->name,
18+
'label' => $source->label,
19+
'usesContext' => $source->uses_context,
3020
);
31-
// Add `usesContext` property if exists.
32-
if ( ! empty( $source_properties->uses_context ) ) {
33-
$editor_settings['blockBindingsSources'][ $source_name ]['usesContext'] = $source_properties->uses_context;
34-
}
3521
}
22+
$script = sprintf( 'for ( const source of %s ) { ! wp.blocks.getBlockBindingsSource( source.name ) && wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) );
23+
wp_add_inline_script(
24+
'wp-blocks',
25+
$script
26+
);
3627
}
37-
return $editor_settings;
3828
}
3929

40-
add_filter( 'block_editor_settings_all', 'gutenberg_add_server_block_bindings_sources_to_editor_settings', 10 );
30+
add_action( 'enqueue_block_editor_assets', 'gutenberg_bootstrap_server_block_bindings_sources', 5 );
4131

4232
/**
4333
* Initialize `canUpdateBlockBindings` editor setting if it doesn't exist. By default, it is `true` only for admin users.

lib/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function gutenberg_menu() {
5151
'gutenberg',
5252
__( 'Experiments Settings', 'gutenberg' ),
5353
__( 'Experiments', 'gutenberg' ),
54-
'edit_posts',
54+
'manage_options',
5555
'gutenberg-experiments',
5656
'the_gutenberg_experiments'
5757
);

0 commit comments

Comments
 (0)