Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
- Raise the minimum required Node.js version to `>=22.13.0`, for stable `require(esm)` support ([#84313](https://github.com/WordPress/gutenberg/pull/84313)).
- Stop normalizing deprecated responsive style state aliases while parsing blocks; saved style attributes must use canonical state keys ([#84531](https://github.com/WordPress/gutenberg/pull/84531)).

### Bug Fixes

- `getBlockSupport` and `hasBlockSupport`: Accept the feature as an array of path segments in the types, as the store selectors and runtime already do ([#84708](https://github.com/WordPress/gutenberg/pull/84708)).

## 16.2.0 (2026-10-07)

### Bug Fixes
Expand Down
4 changes: 2 additions & 2 deletions packages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ Returns the block support value for a feature, if defined.
_Parameters_

- _nameOrType_ `string | BlockType`: Block name or type object
- _feature_ `string`: Feature to retrieve
- _feature_ `string | string[]`: Feature to retrieve, as a dot-separated path or an array of path segments
- _defaultSupports_ `unknown`: Default value to return if not explicitly defined

_Returns_
Expand Down Expand Up @@ -340,7 +340,7 @@ Returns true if the block defines support for a feature, or false otherwise.
_Parameters_

- _nameOrType_ `string | BlockType`: Block name or type object.
- _feature_ `string`: Feature to test.
- _feature_ `string | string[]`: Feature to test, as a dot-separated path or an array of path segments.
- _defaultSupports_ `boolean`: Whether feature is supported by default if not explicitly defined.

_Returns_
Expand Down
10 changes: 6 additions & 4 deletions packages/blocks/src/api/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,16 @@ export function getBlockTypes(): BlockType[] {
* Returns the block support value for a feature, if defined.
*
* @param nameOrType Block name or type object
* @param feature Feature to retrieve
* @param feature Feature to retrieve, as a dot-separated path or an
* array of path segments
* @param defaultSupports Default value to return if not
* explicitly defined
*
* @return Block support value
*/
export function getBlockSupport(
nameOrType: string | BlockType,
feature: string,
feature: string | string[],
defaultSupports?: unknown
): unknown {
return select( blocksStore ).getBlockSupport(
Expand All @@ -471,15 +472,16 @@ export function getBlockSupport(
* Returns true if the block defines support for a feature, or false otherwise.
*
* @param nameOrType Block name or type object.
* @param feature Feature to test.
* @param feature Feature to test, as a dot-separated path or an array
* of path segments.
* @param defaultSupports Whether feature is supported by
* default if not explicitly defined.
*
* @return Whether block supports feature.
*/
export function hasBlockSupport(
nameOrType: string | BlockType,
feature: string,
feature: string | string[],
defaultSupports?: boolean
): boolean {
return select( blocksStore ).hasBlockSupport(
Expand Down
Loading