Skip to content

Commit

Permalink
prep build 03/28
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Mar 28, 2024
2 parents 79054bc + 4cfaab6 commit 5b9d2f1
Show file tree
Hide file tree
Showing 117 changed files with 2,524 additions and 1,729 deletions.
14 changes: 12 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
== Changelog ==

= 18.0.0-rc.1 =

= 18.0.0 =

## Changelog

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

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

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

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

#### Components
- Button : Deprecate `isSmall` prop. ([59734](https://github.com/WordPress/gutenberg/pull/59734))
Expand Down Expand Up @@ -304,6 +312,8 @@ The following contributors merged PRs in this release:
@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




= 17.9.0 =


Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/code/back-merging-to-wp-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ There are however certain exceptions to that rule. PRs with the following criter

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

## Further Reading

Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/code/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Once approved, the new Gutenberg version will be available to WordPress users al

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.

#### Troubleshooting the release
### Troubleshooting the release

> The plugin was published to the WordPress.org plugin directory but the workflow failed.
Expand Down
2 changes: 1 addition & 1 deletion docs/explanations/architecture/styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ For example:

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).

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.
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.

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

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/fundamentals/registration-of-a-block.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ register_block_type(
);
```

Here is a more complete example, including the `init` hook.
Here is a more complete example, including the `init` hook.

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

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

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:
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:

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

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

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

Expand Down
10 changes: 5 additions & 5 deletions docs/getting-started/fundamentals/static-dynamic-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ A block's front-end markup can either be dynamically generated server-side upon
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.
</div>

## Static rendering
## Static rendering

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.

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."
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."

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

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

<details><summary><strong>View an example of static rendering in the Preformatted block</strong></summary>
<br/>
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:
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:

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

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

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.
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.

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.

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

- [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
- [Block deprecation – a tutorial](https://developer.wordpress.org/news/2023/03/10/block-deprecation-a-tutorial/) | Developer Blog
- [Block deprecation – a tutorial](https://developer.wordpress.org/news/2023/03/10/block-deprecation-a-tutorial/) | Developer Blog
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Disable Editor functionality

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.
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.

## Restrict block options

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).
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).

## Disable the Pattern Directory

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

```php
function example_theme_support() {
Expand All @@ -21,7 +21,7 @@ add_action( 'after_setup_theme', 'example_theme_support' );

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.

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

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

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.

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.
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.

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

Expand All @@ -58,7 +58,7 @@ wp.domReady( () => {
});
```

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.
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.

## Disable access to the Template Editor

Expand All @@ -71,7 +71,7 @@ function example_theme_support() {
add_action( 'after_setup_theme', 'example_theme_support' );
```

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

## Disable access to the Code Editor

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

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.
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.
18 changes: 18 additions & 0 deletions docs/reference-guides/filters/block-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,24 @@ wp.hooks.addFilter(
```


### `editor.postContentBlockTypes`

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.

_Example:_

```js
const addExampleBlockToPostContentBlockTypes = ( blockTypes ) => {
return [ ...blockTypes, 'namespace/example' ];
};

wp.hooks.addFilter(
'editor.postContentBlockTypes',
'my-plugin/post-content-block-types',
addExampleBlockToPostContentBlockTypes
);
```

## Removing Blocks

### Using a deny list
Expand Down
Loading

0 comments on commit 5b9d2f1

Please sign in to comment.