Skip to content

Commit 8d2888d

Browse files
tyxlamcsf
andauthored
Core Block Reference: Fix object empty inner key processing (#75391)
Co-authored-by: tyxla <tyxla@git.wordpress.org> Co-authored-by: mcsf <mcsf@git.wordpress.org>
1 parent 9f8ac78 commit 8d2888d

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bin/api-docs/gen-block-lib-list.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* External dependencies
99
*/
1010
const path = require( 'path' );
11-
const glob = require( 'fast-glob' );
1211
const fs = require( 'fs' );
12+
const glob = require( 'fast-glob' );
1313
/**
1414
* Path to root project directory.
1515
*
@@ -93,7 +93,11 @@ function processObjWithInnerKeys( obj ) {
9393
rtn.push( `${ key } (${ obj[ key ].sort().join( ', ' ) })` );
9494
} else if ( typeof obj[ key ] === 'object' ) {
9595
const innerKeys = getTruthyKeys( obj[ key ] );
96-
rtn.push( `${ key } (${ innerKeys.sort().join( ', ' ) })` );
96+
if ( innerKeys.length ) {
97+
rtn.push( `${ key } (${ innerKeys.sort().join( ', ' ) })` );
98+
} else {
99+
rtn.push( key );
100+
}
97101
} else {
98102
rtn.push( key );
99103
}

docs/reference-guides/core-blocks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Prompt visitors to take action with a button-style link. ([Source](https://githu
101101
- **Name:** core/button
102102
- **Category:** design
103103
- **Parent:** core/buttons
104-
- **Supports:** anchor, color (background, gradients, text), interactivity (clientNavigation), shadow (), spacing (padding), splitting, typography (fontSize, lineHeight, textAlign), ~~alignWide~~, ~~align~~, ~~reusable~~
104+
- **Supports:** anchor, color (background, gradients, text), interactivity (clientNavigation), shadow, spacing (padding), splitting, typography (fontSize, lineHeight, textAlign), ~~alignWide~~, ~~align~~, ~~reusable~~
105105
- **Attributes:** backgroundColor, gradient, linkTarget, placeholder, rel, tagName, text, textColor, title, type, url, width
106106

107107
## Buttons
@@ -435,7 +435,7 @@ Insert an image to make a visual statement. ([Source](https://github.com/WordPre
435435

436436
- **Name:** core/image
437437
- **Category:** media
438-
- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity, shadow (), spacing (margin)
438+
- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity, shadow, spacing (margin)
439439
- **Attributes:** alt, aspectRatio, blob, caption, focalPoint, height, href, id, lightbox, linkClass, linkDestination, linkTarget, rel, scale, sizeSlug, title, url, width
440440

441441
## Latest Comments
@@ -726,7 +726,7 @@ Display a post's featured image. ([Source](https://github.com/WordPress/gutenber
726726

727727
- **Name:** core/post-featured-image
728728
- **Category:** theme
729-
- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity (clientNavigation), shadow (), spacing (margin, padding), ~~html~~
729+
- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity (clientNavigation), shadow, spacing (margin, padding), ~~html~~
730730
- **Attributes:** aspectRatio, customGradient, customOverlayColor, dimRatio, gradient, height, isLink, linkTarget, overlayColor, rel, scale, sizeSlug, useFirstImageFromPost, width
731731

732732
## Post Navigation Link

0 commit comments

Comments
 (0)