Skip to content

Commit 5b9d2f1

Browse files
committed
prep build 03/28
2 parents 79054bc + 4cfaab6 commit 5b9d2f1

File tree

117 files changed

+2524
-1729
lines changed

Some content is hidden

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

117 files changed

+2524
-1729
lines changed

changelog.txt

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
== Changelog ==
22

3-
= 18.0.0-rc.1 =
4-
3+
= 18.0.0 =
54

65
## Changelog
76

@@ -81,6 +80,10 @@
8180
- Template Parts: Fix typo in translatable string. ([59816](https://github.com/WordPress/gutenberg/pull/59816))
8281
- Ensure consistent return type in `WP_Navigation_Block_Renderer::Get_markup_for_inner_block()`. ([59820](https://github.com/WordPress/gutenberg/pull/59820))
8382
- Return early from saving meta data for the navigation without a $post->ID. ([59875](https://github.com/WordPress/gutenberg/pull/59875))
83+
- Fix root ID calculation when check if block can be transformed. ([60167](https://github.com/WordPress/gutenberg/pull/60167))
84+
- Featured Image: Fix overlay rendering in the editor. ([60187](https://github.com/WordPress/gutenberg/pull/60187))
85+
- Fix self closing navigation overlay. ([60130](https://github.com/WordPress/gutenberg/pull/60130))
86+
- Navigation: Avoid content loss when only specific entity fields are edited. ([60071](https://github.com/WordPress/gutenberg/pull/60071))
8487

8588
#### Font Library
8689
- Avoid auto-removing font families without font faces. ([59910](https://github.com/WordPress/gutenberg/pull/59910))
@@ -90,6 +93,8 @@
9093
- Polish Google Fonts consent box. ([59631](https://github.com/WordPress/gutenberg/pull/59631))
9194
- Refactors the upload handler in order to check if files being uploaded are valid font files. ([59648](https://github.com/WordPress/gutenberg/pull/59648))
9295
- Reset notices when navigating away from the collection. ([59981](https://github.com/WordPress/gutenberg/pull/59981))
96+
- Activate the fonts coming from the backend and not the data from the frontend. ([60093](https://github.com/WordPress/gutenberg/pull/60093))
97+
- Install fonts in sequence to work around race condition. ([60180](https://github.com/WordPress/gutenberg/pull/60180))
9398

9499
#### Interactivity API
95100
- Backport fixes from Core. ([59903](https://github.com/WordPress/gutenberg/pull/59903))
@@ -122,6 +127,8 @@
122127
- Remove filter for same number of settings. ([59590](https://github.com/WordPress/gutenberg/pull/59590))
123128
- Site editor: Find font families for typography presets crashes editor. ([59806](https://github.com/WordPress/gutenberg/pull/59806))
124129
- Force root min-height of 100% for backgrounds. ([59809](https://github.com/WordPress/gutenberg/pull/59809))
130+
- Featured Image: Fix block support selectors after shadow support addition. ([60184](https://github.com/WordPress/gutenberg/pull/60184))
131+
- Fix list of base theme fonts when a theme variation is applied.. ([59959](https://github.com/WordPress/gutenberg/pull/59959))
125132

126133
#### Patterns
127134
- Add pattern title in create modal in post editor. ([59550](https://github.com/WordPress/gutenberg/pull/59550))
@@ -224,6 +231,7 @@
224231
- Don't memoize callbacks in 'BlockSettingsDropdown'. ([59397](https://github.com/WordPress/gutenberg/pull/59397))
225232
- Link dialog: Remove CSS hack. ([59746](https://github.com/WordPress/gutenberg/pull/59746))
226233
- Pattern Explorer: Remove leftover source filter state handlers. ([60019](https://github.com/WordPress/gutenberg/pull/60019))
234+
- Fix code formatting in Nav block view file. ([60162](https://github.com/WordPress/gutenberg/pull/60162))
227235

228236
#### Components
229237
- Button : Deprecate `isSmall` prop. ([59734](https://github.com/WordPress/gutenberg/pull/59734))
@@ -304,6 +312,8 @@ The following contributors merged PRs in this release:
304312
@aaronrobertshaw @afercia @afragen @ajlende @alexstine @andrewfleming @anton-vlasenko @artemiomorales @bacoords @c4rl0sbr4v0 @carolinan @chrisbellboy @colinduwe @creativecoder @DAreRodz @dcalhoun @draganescu @ellatrix @enejb @enodekciw @flexseth @fluiddot @gaambo @georgestephanis @geriux @getdave @huzaifaalmesbah @inc2734 @J0n-92 @jaclync @jameskoster @jasmussen @Jayanth-Parthsarathy @jeryj @jorgefilipecosta @jsnajdr @kevin940726 @krokodok @luislard @Mamaduka @matiasbenedetto @mattsherman @mcsf @megane9988 @michalczaplinski @mirka @mujuonly @mzahir @ndiego @noisysocks @ntsekouras @oandregal @pbking @ramonjd @rcoll @SahilThakur02 @Sam-Xronn @scruffian @shail-mehta @SiobhyB @sirreal @Soean @Strangehill @sunil25393 @swissspidy @t-hamano @talldan @tellthemachines @TeresaGobble @tjcafferkey @tomepajk @tyxla @vcanales @youknowriad
305313

306314

315+
316+
307317
= 17.9.0 =
308318

309319

docs/contributors/code/back-merging-to-wp-core.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ There are however certain exceptions to that rule. PRs with the following criter
3131

3232
- Does not contain changes to PHP code.
3333
- Has label `Backport from WordPress Core` - this code is already in WP Core and is being synchronized back to Gutenberg.
34-
- Has label `Backport to WordPress Core` - this code has already been syncrhonized to WP Core.
34+
- Has label `Backport to WordPress Core` - this code has already been synchronized to WP Core.
3535

3636
## Further Reading
3737

docs/contributors/code/release.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Once approved, the new Gutenberg version will be available to WordPress users al
223223

224224
The final step is to write a release post on [make.wordpress.org/core](https://make.wordpress.org/core/). You can find some tips on that below.
225225

226-
#### Troubleshooting the release
226+
### Troubleshooting the release
227227

228228
> The plugin was published to the WordPress.org plugin directory but the workflow failed.
229229

docs/explanations/architecture/styles.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ For example:
7878

7979
The paragraph declares support for font size in its `block.json`. This means the block will show a UI control for users to tweak its font size, unless it's disabled by the theme (learn more about how themes can disable UI controls in [the `theme.json` reference](https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/)). The system will also take care of setting up the UI control data (the font size of the block if it has one already assigned, the list of available font sizes to show), and will serialize the block data into HTML markup upon user changes (attach classes and inline styles appropriately).
8080

81-
By using the block supports mechanism via `block.json`, the block author is able to create the same experience as before just by writing a couple of lines. Check the tutorials for adding block supports to [static](/docs/how-to-guides/block-tutorial/block-supports-in-static-blocks.md) and [dynamic](/docs/how-to-guides/block-tutorial/block-supports-in-dynamic-blocks.md) blocks.
81+
By using the block supports mechanism via `block.json`, the block author is able to create the same experience as before just by writing a couple of lines. Check the [block supports api](/docs/reference-guides/block-api/block-supports.md) for adding block supports to static or dynamic blocks.
8282

8383
Besides the benefit of having to do less work to achieve the same results, there's a few other advantages:
8484

docs/getting-started/fundamentals/registration-of-a-block.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ register_block_type(
3333
);
3434
```
3535

36-
Here is a more complete example, including the `init` hook.
36+
Here is a more complete example, including the `init` hook.
3737

3838
```php
3939
function minimal_block_ca6eda___register_block() {
@@ -46,7 +46,7 @@ _See the [full block example](https://github.com/WordPress/block-development-exa
4646

4747
## Registering a block with JavaScript (client-side)
4848

49-
When the block has already been registered on the server, you only need to register the client-side settings in JavaScipt using the [`registerBlockType`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-blocks/#registerblocktype) method from the `@wordpress/blocks` package. You just need to make sure you use the same block name as defined in the block's `block.json` file. Here's an example:
49+
When the block has already been registered on the server, you only need to register the client-side settings in JavaScript using the [`registerBlockType`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-blocks/#registerblocktype) method from the `@wordpress/blocks` package. You just need to make sure you use the same block name as defined in the block's `block.json` file. Here's an example:
5050

5151
```js
5252
import { registerBlockType } from '@wordpress/blocks';
@@ -71,7 +71,7 @@ The function accepts two parameters:
7171
The `settings` object passed as the second parameter includes many properties, but these are the two most important ones:
7272

7373
- **`edit`:** The React component that gets used in the Editor for our block.
74-
- **`save`:** The function that returns the static HTML markup that gets saved to the database.
74+
- **`save`:** The function that returns the static HTML markup that gets saved to the database.
7575

7676
The `registerBlockType()` function returns the registered block type (`WPBlock`) on success or `undefined` on failure. Here's an example:
7777

docs/getting-started/fundamentals/static-dynamic-rendering.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ A block's front-end markup can either be dynamically generated server-side upon
66
The post <a href="https://developer.wordpress.org/news/2023/02/27/static-vs-dynamic-blocks-whats-the-difference/">Static vs. dynamic blocks: What’s the difference?</a> provides a great introduction to this topic.
77
</div>
88

9-
## Static rendering
9+
## Static rendering
1010

1111
Blocks with "static rendering" produce front-end output that is fixed and stored in the database upon saving. These blocks rely solely on their `save` function to define their [HTML markup](https://developer.wordpress.org/block-editor/getting-started/fundamentals/markup-representation-block/), which remains unchanged unless manually edited in the Block Editor.
1212

13-
If a block does not use a dynamic rendering method—meaning it doesn't generate content on the fly via PHP when the page loads—it's considered a "static block."
13+
If a block does not use a dynamic rendering method—meaning it doesn't generate content on the fly via PHP when the page loads—it's considered a "static block."
1414

1515
The diagram below illustrates how static block content is saved in the database and then retrieved and rendered as HTML on the front end.
1616

@@ -24,7 +24,7 @@ Blocks in WordPress are encapsulated within special comment tags that serve as u
2424

2525
<details><summary><strong>View an example of static rendering in the Preformatted block</strong></summary>
2626
<br/>
27-
The following <a href="https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/preformatted/save.js"><code>save</code> function</a> for the <a hreh="https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/preformatted">Preformatted</a> core block looks like this:
27+
The following <a href="https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/preformatted/save.js"><code>save</code> function</a> for the <a href="https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src/preformatted">Preformatted</a> core block looks like this:
2828

2929
```js
3030
import { RichText, useBlockProps } from '@wordpress/block-editor';
@@ -160,7 +160,7 @@ On the front end, the `render_callback` is used to dynamically render the markup
160160

161161
### HTML representation of dynamic blocks in the database (`save`)
162162

163-
For dynamic blocks, the `save` callback function can return just `null`, which tells the editor to save only the block delimiter comment (along with any existing [block attributes](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/)) to the database. These attributes are then passed into the server-side rendering callback, which will determine how to display the block on the front end of your site.
163+
For dynamic blocks, the `save` callback function can return just `null`, which tells the editor to save only the block delimiter comment (along with any existing [block attributes](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/)) to the database. These attributes are then passed into the server-side rendering callback, which will determine how to display the block on the front end of your site.
164164

165165
When `save` is `null`, the Block Editor will skip the [block markup validation process](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#validation), avoiding issues with frequently changing markup.
166166

@@ -176,4 +176,4 @@ If you are using [InnerBlocks](https://developer.wordpress.org/block-editor/how-
176176
## Additional resources
177177

178178
- [Static vs. dynamic blocks: What’s the difference?](https://developer.wordpress.org/news/2023/02/27/static-vs-dynamic-blocks-whats-the-difference/) | Developer Blog
179-
- [Block deprecation – a tutorial](https://developer.wordpress.org/news/2023/03/10/block-deprecation-a-tutorial/) | Developer Blog
179+
- [Block deprecation – a tutorial](https://developer.wordpress.org/news/2023/03/10/block-deprecation-a-tutorial/) | Developer Blog

docs/how-to-guides/curating-the-editor-experience/disable-editor-functionality.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Disable Editor functionality
22

3-
This page is dedicated to the many ways you can disable specific functionality in the Post Editor and Site Editor that are not covered in other areas of the curation documentation.
3+
This page is dedicated to the many ways you can disable specific functionality in the Post Editor and Site Editor that are not covered in other areas of the curation documentation.
44

55
## Restrict block options
66

7-
There might be times when you don’t want access to a block at all to be available for users. To control what’s available in the inserter, you can take two approaches: [an allow list](/docs/reference-guides/filters/block-filters.md#using-an-allow-list) that disables all blocks except those on the list or a [deny list that unregisters specific blocks](/docs/reference-guides/filters/block-filters.md#using-a-deny-list).
7+
There might be times when you don’t want access to a block at all to be available for users. To control what’s available in the inserter, you can take two approaches: [an allow list](/docs/reference-guides/filters/block-filters.md#using-an-allow-list) that disables all blocks except those on the list or a [deny list that unregisters specific blocks](/docs/reference-guides/filters/block-filters.md#using-a-deny-list).
88

99
## Disable the Pattern Directory
1010

11-
To fully remove patterns bundled with WordPress core from being accessed in the Inserter, the following can be added to your `functions.php` file:
11+
To fully remove patterns bundled with WordPress core from being accessed in the Inserter, the following can be added to your `functions.php` file:
1212

1313
```php
1414
function example_theme_support() {
@@ -21,7 +21,7 @@ add_action( 'after_setup_theme', 'example_theme_support' );
2121

2222
Some Core blocks are actually [block variations](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-variations/). A great example is the Row and Stack blocks, which are actually variations of the Group block. If you want to disable these "blocks", you actually need to disable the respective variations.
2323

24-
Block variations are registered using JavaScript and need to be disabled with JavaScript. The code below will disable the Row variation.
24+
Block variations are registered using JavaScript and need to be disabled with JavaScript. The code below will disable the Row variation.
2525

2626
```js
2727
wp.domReady( () => {
@@ -48,7 +48,7 @@ add_action( 'enqueue_block_editor_assets', 'example_disable_variations_script' )
4848

4949
There are a few Core blocks that include their own [block styles](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/). An example is the Image block, which includes a block style for rounded images called "Rounded". You many not want your users to round images, or you might prefer to use the border-radius control instead of the block style. Either way, it's easy to disable any unwanted block styles.
5050

51-
Unlike block variations, you can register styles in either JavaScript or PHP. If a style was registered in JavaScript, it must be disabled with JavaScript. If registered using PHP, the style can be disabled with either. All Core block styles are registed in JavaScript.
51+
Unlike block variations, you can register styles in either JavaScript or PHP. If a style was registered in JavaScript, it must be disabled with JavaScript. If registered using PHP, the style can be disabled with either. All Core block styles are registered in JavaScript.
5252

5353
So, you would use the following code to disable the "Rounded" block style for the Image block.
5454

@@ -58,7 +58,7 @@ wp.domReady( () => {
5858
});
5959
```
6060

61-
This JavaScript should be enqueued much like the block variation example above. Refer to the [block styles](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/) documentation for how to register and unregister styles using PHP.
61+
This JavaScript should be enqueued much like the block variation example above. Refer to the [block styles](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-styles/) documentation for how to register and unregister styles using PHP.
6262

6363
## Disable access to the Template Editor
6464

@@ -71,7 +71,7 @@ function example_theme_support() {
7171
add_action( 'after_setup_theme', 'example_theme_support' );
7272
```
7373

74-
This prevents both the ability to create new block templates or edit them from within the Post Editor.
74+
This prevents both the ability to create new block templates or edit them from within the Post Editor.
7575

7676
## Disable access to the Code Editor
7777

@@ -86,4 +86,4 @@ function example_restrict_code_editor_access( $settings, $context ) {
8686
add_filter( 'block_editor_settings_all', 'example_restrict_code_editor_access', 10, 2 );
8787
```
8888

89-
This code prevents all users from accessing the Code Editor. You could also add [capability](https://wordpress.org/documentation/article/roles-and-capabilities/) checks to disable access for specific users.
89+
This code prevents all users from accessing the Code Editor. You could also add [capability](https://wordpress.org/documentation/article/roles-and-capabilities/) checks to disable access for specific users.

docs/reference-guides/filters/block-filters.md

+18
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,24 @@ wp.hooks.addFilter(
283283
```
284284

285285

286+
### `editor.postContentBlockTypes`
287+
288+
Used to modify the list of blocks that should be enabled even when used inside a locked template. Any block that saves data to a post should be added here. Examples of this are the post featured image block. Which often gets used in templates but should still allow selecting the image even when the template is locked.
289+
290+
_Example:_
291+
292+
```js
293+
const addExampleBlockToPostContentBlockTypes = ( blockTypes ) => {
294+
return [ ...blockTypes, 'namespace/example' ];
295+
};
296+
297+
wp.hooks.addFilter(
298+
'editor.postContentBlockTypes',
299+
'my-plugin/post-content-block-types',
300+
addExampleBlockToPostContentBlockTypes
301+
);
302+
```
303+
286304
## Removing Blocks
287305

288306
### Using a deny list

0 commit comments

Comments
 (0)