Skip to content

Commit

Permalink
Merge branch 'trunk' into add/interactivity-api-wp-each
Browse files Browse the repository at this point in the history
  • Loading branch information
luisherranz committed Jan 23, 2024
2 parents a115a92 + 38f8eaa commit 187910f
Show file tree
Hide file tree
Showing 91 changed files with 1,005 additions and 10,844 deletions.
17 changes: 17 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
== Changelog ==

= 17.5.1 =

## Changelog

### Bug Fixes

- (Preferences)(hotfix)(17.5) Hotfix for missing preferences in the `core` scope([58031](https://github.com/WordPress/gutenberg/pull/58031))

## Contributors

The following contributors merged PRs in this release:

@youknowriad @fullofcaffeine




= 17.5.0 =

## Changelog
Expand Down
16 changes: 8 additions & 8 deletions docs/reference-guides/filters/block-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ _Example_:
```php
<?php

function filter_metadata_registration( $metadata ) {
function wpdocs_filter_metadata_registration( $metadata ) {
$metadata['apiVersion'] = 1;
return $metadata;
};
add_filter( 'block_type_metadata', 'filter_metadata_registration' );
add_filter( 'block_type_metadata', 'wpdocs_filter_metadata_registration' );

register_block_type( __DIR__ );
```
Expand All @@ -40,11 +40,11 @@ The filter takes two params:
_Example:_

```php
function filter_metadata_registration( $settings, $metadata ) {
function wpdocs_filter_metadata_registration( $settings, $metadata ) {
$settings['api_version'] = $metadata['apiVersion'] + 1;
return $settings;
};
add_filter( 'block_type_metadata_settings', 'filter_metadata_registration', 10, 2 );
add_filter( 'block_type_metadata_settings', 'wpdocs_filter_metadata_registration', 10, 2 );

register_block_type( __DIR__ );
```
Expand Down Expand Up @@ -352,14 +352,14 @@ On the server, you can filter the list of blocks shown in the inserter using the
<?php
// my-plugin.php

function filter_allowed_block_types_when_post_provided( $allowed_block_types, $editor_context ) {
function wpdocs_filter_allowed_block_types_when_post_provided( $allowed_block_types, $editor_context ) {
if ( ! empty( $editor_context->post ) ) {
return array( 'core/paragraph', 'core/heading' );
}
return $allowed_block_types;
}

add_filter( 'allowed_block_types_all', 'filter_allowed_block_types_when_post_provided', 10, 2 );
add_filter( 'allowed_block_types_all', 'wpdocs_filter_allowed_block_types_when_post_provided', 10, 2 );
```

## Managing block categories
Expand All @@ -374,7 +374,7 @@ It is possible to filter the list of default block categories using the `block_c
<?php
// my-plugin.php

function filter_block_categories_when_post_provided( $block_categories, $editor_context ) {
function wpdocs_filter_block_categories_when_post_provided( $block_categories, $editor_context ) {
if ( ! empty( $editor_context->post ) ) {
array_push(
$block_categories,
Expand All @@ -388,7 +388,7 @@ function filter_block_categories_when_post_provided( $block_categories, $editor_
return $block_categories;
}

add_filter( 'block_categories_all', 'filter_block_categories_when_post_provided', 10, 2 );
add_filter( 'block_categories_all', 'wpdocs_filter_block_categories_when_post_provided', 10, 2 );
```

### `wp.blocks.updateCategory`
Expand Down
8 changes: 4 additions & 4 deletions docs/reference-guides/filters/editor-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ _Example:_
<?php
// my-plugin.php

function filter_block_editor_settings_when_post_provided( $editor_settings, $editor_context ) {
function wpdocs_filter_block_editor_settings_when_post_provided( $editor_settings, $editor_context ) {
if ( ! empty( $editor_context->post ) ) {
$editor_settings['maxUploadFileSize'] = 12345;
}
return $editor_settings;
}

add_filter( 'block_editor_settings_all', 'filter_block_editor_settings_when_post_provided', 10, 2 );
add_filter( 'block_editor_settings_all', 'wpdocs_filter_block_editor_settings_when_post_provided', 10, 2 );
```

#### `block_editor_rest_api_preload_paths`
Expand All @@ -104,14 +104,14 @@ _Example:_
<?php
// my-plugin.php

function filter_block_editor_rest_api_preload_paths_when_post_provided( $preload_paths, $editor_context ) {
function wpdocs_filter_block_editor_rest_api_preload_paths_when_post_provided( $preload_paths, $editor_context ) {
if ( ! empty( $editor_context->post ) ) {
array_push( $preload_paths, array( '/wp/v2/blocks', 'OPTIONS' ) );
}
return $preload_paths;
}

add_filter( 'block_editor_rest_api_preload_paths', 'filter_block_editor_rest_api_preload_paths_when_post_provided', 10, 2 );
add_filter( 'block_editor_rest_api_preload_paths', 'wpdocs_filter_block_editor_rest_api_preload_paths_when_post_provided', 10, 2 );
```

### Available default editor settings
Expand Down
4 changes: 2 additions & 2 deletions docs/reference-guides/filters/global-styles-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _Example:_
This is how to pass a new color palette for the theme and disable the text color UI:

```php
function filter_theme_json_theme( $theme_json ){
function wpdocs_filter_theme_json_theme( $theme_json ){
$new_data = array(
'version' => 2,
'settings' => array(
Expand All @@ -38,5 +38,5 @@ function filter_theme_json_theme( $theme_json ){

return $theme_json->update_with( $new_data );
}
add_filter( 'wp_theme_json_data_theme', 'filter_theme_json_theme' );
add_filter( 'wp_theme_json_data_theme', 'wpdocs_filter_theme_json_theme' );
```
4 changes: 2 additions & 2 deletions docs/reference-guides/filters/parser-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class EmptyParser {
}
}

function my_plugin_select_empty_parser( $prev_parser_class ) {
function wpdocs_select_empty_parser( $prev_parser_class ) {
return 'EmptyParser';
}

add_filter( 'block_parser_class', 'my_plugin_select_empty_parser', 10, 1 );
add_filter( 'block_parser_class', 'wpdocs_select_empty_parser', 10, 1 );
```

> **Note**: At the present time it's not possible to replace the client-side parser.
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Printing since 1440. This is the development plugin for the block editor, site editor, and other future WordPress core functionality.
* Requires at least: 6.3
* Requires PHP: 7.0
* Version: 17.5.0
* Version: 17.5.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
4 changes: 2 additions & 2 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ protected static function get_blocks_metadata() {

if ( $duotone_support ) {
$root_selector = wp_get_block_css_selector( $block_type );
$duotone_selector = WP_Theme_JSON_Gutenberg::scope_selector( $root_selector, $duotone_support );
$duotone_selector = static::scope_selector( $root_selector, $duotone_support );
}
}

Expand Down Expand Up @@ -1185,7 +1185,7 @@ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets'
$setting_nodes[ $root_settings_key ]['selector'] = $options['root_selector'];
}
if ( false !== $root_style_key ) {
$setting_nodes[ $root_style_key ]['selector'] = $options['root_selector'];
$style_nodes[ $root_style_key ]['selector'] = $options['root_selector'];
}
}

Expand Down

This file was deleted.

Loading

0 comments on commit 187910f

Please sign in to comment.