-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Gallery block refactor: remove the imageCount attribute #33677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
8586af7
f1d7616
427065f
ba7ffcd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,6 @@ import { | |
| import { __ } from '@wordpress/i18n'; | ||
| import { createBlock } from '@wordpress/blocks'; | ||
|
|
||
| /** | ||
| * Internal dependencies | ||
| */ | ||
| import { defaultColumnsNumber } from './shared'; | ||
|
|
||
| const allowedBlocks = [ 'core/image' ]; | ||
|
|
||
| export const Gallery = ( props ) => { | ||
|
|
@@ -37,13 +32,7 @@ export const Gallery = ( props ) => { | |
| blockProps, | ||
| } = props; | ||
|
|
||
| const { | ||
| imageCount, | ||
| align, | ||
| columns = defaultColumnsNumber( imageCount ), | ||
| caption, | ||
| imageCrop, | ||
| } = attributes; | ||
| const { align, columns = 'default', caption, imageCrop } = attributes; | ||
|
||
|
|
||
| const { children, ...innerBlocksProps } = useInnerBlocksProps( blockProps, { | ||
| allowedBlocks, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,6 @@ export const settings = { | |
| example: { | ||
| attributes: { | ||
| columns: 2, | ||
| imageCount: 2, | ||
| }, | ||
| innerBlocks: [ | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be safest to make it
!! innerBlockImages?.length, just in caseinnerBlocksis everundefinedfor some reason.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeh, that makes sense, done.