-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Paragraph block: Backward compatibility support for align attribute #73578
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
Paragraph block: Backward compatibility support for align attribute #73578
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +148 B (+0.01%) Total Size: 2.54 MB
ℹ️ View Unchanged
|
t-hamano
left a comment
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.
LGTM! We'll probably migrate attributes.textAlign to styles.typography.textAlign in all blocks from now on, but will we add a similar deprecation to all blocks?
Yes, we can probably share the same hook (in the other blocks, paragraph is special) |
|
I just cherry-picked this PR to the release/22.1 branch to get it included in the next release: d01ce3b |
What?
In #73111 We remove the align attribute from the paragraph block. The issue though is that we didn't take into consideration plugins that might still be updating this attribute programmatically, like plugins adding "justify" buttons.
This PR adds a shim for these plugins while throwing a deprecation message.
Testing Instructions
1- Insert a paragraph block
2- Open the browser console
3- Update the align attribute programmatically, something like
Notice that the alignment of the paragraph changes as you call the updateBlockAttribute function. Also a deprecation is printed in the console the first time you do it.