-
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
Quote v2: add align feature to have feature parity with v1 #39876
Conversation
Size Change: +22 B (0%) Total Size: 1.22 MB
ℹ️ View Unchanged
|
/** | ||
* WordPress dependencies | ||
*/ | ||
import { InnerBlocks, RichText, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
export default function save( { attributes } ) { | ||
const { citation } = attributes; | ||
const blockProps = useBlockProps.save(); | ||
const { align, citation } = attributes; |
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.
It's so bad that this attribute is called "align" instead of "textAlign" as "align" is also a reserved attribute for the block alignments hook. But I guess that's probably not limited to v2 of quote and may exist in other blocks too.
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.
Yeah, this is a v1 attribute so I didn't want to change now that we're focused on bringing the minimum changes possible to v2.
What?
This PR adds the ability to align the contents of the quote v2, similarly to what's possible with v1.
Why?
We want to have feature parity.
How?
Uses the existing
align
attribute to attach the classes onedit
andsave
functions.Testing Instructions