Skip to content

Commit

Permalink
prep build 01/23
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Jan 23, 2024
2 parents d2917c3 + 38f8eaa commit 5004c91
Show file tree
Hide file tree
Showing 105 changed files with 1,229 additions and 10,866 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
31 changes: 31 additions & 0 deletions docs/contributors/code/back-merging-to-wp-core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Back-merging code to WordPress Core

For major releases of the WordPress software, Gutenberg features need to be merged into WordPress Core. Typically this involves taking changes made in `.php` files within the Gutenberg repository and making the equivalent updates in the WP Core codebase.

## Files/Directories

Changes to files within the following files/directories will typically require back-merging to WP Core:

- `lib/`
- `phpunit/`

## Ignored directories/files

The following directories/files do _not_ require back-merging to WP Core:

- `lib/load.php` - Plugin specific code.
- `lib/experiments-page.php` - experiments are Plugin specific.
- `packages/block-library` - this is handled automatically during the packages sync process.
- `packages/e2e-tests/plugins` - PHP files related to e2e tests only. Mostly fixture data generators.
- `phpunit/blocks` - the code is maintained in Gutenberg so the test should be as well.

Please note this list is not exhaustive.

## Pull Request Criteria

In general, all PHP code committed to the Gutenberg repository since the date of the final Gutenberg release that was included in [the _last_ stable WP Core release](https://developer.wordpress.org/block-editor/contributors/versions-in-wordpress/) should be considered for back merging to WP Core.

There are however certain exceptions to that rule. PRs with the following criteria do _not_ require back-merging to WP Core:

- Does not contain changes to PHP code.
- Has label `Backport from WordPress Core` - this code is already in WP Core.
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.
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 5004c91

Please sign in to comment.