-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gallery Block: Remove unused attributes property in shortcode transformation #57356
Conversation
Size Change: -180 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
images: { | ||
type: 'array', | ||
shortcode: ( { named: { ids } } ) => { | ||
if ( ! isGalleryV2Enabled() ) { |
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.
There is no check in transforms
whether the Gallery block is v2 or not. However, since the Gallery block v2 is enabled in all WordPress versions supported by the current Gutenberg plugin, I don't think it is necessary to add this check to transforms
.
@t-hamano, can you share an example shortcode for testing this changes? Thank you! |
@Mamaduka Sorry, I didn't include the actual shortcode. Added to Testing Instructions. |
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.
Thank you, @t-hamano!
I couldn't spot a regression after the cleanup.
Flaky tests detected in f7a66eb. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7306510677
|
Related to #57345
Noticed this while investigating #9701
What?
This PR removes unused
attributes
property during the process of transforming the gallery shortcode to the Gallery block.Why?
When I tried to update the gallery shortcode transformation process, I noticed that
attributes.X.shortcode
was not working. This is because transforms take precedence over attributes, and you can see that they are implemented that way by looking at the code.How?
I just deleted it.
Testing Instructions
[gallery columns="2" link="post" size="large" ids="46,45,44,43,42"]