-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Adds transforms functionality to Post comments link and post comments number #70287
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
Adds transforms functionality to Post comments link and post comments number #70287
Conversation
…mments-link blocks
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. |
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.
Thanks for the PR! This functionality makes sense to me.
Can we keep the textAlign
attribute between the transformation?
Center-aligned Comments Link block:
When converting to the Comments Count, alignment settings are lost:
Code example:
gutenberg/packages/block-library/src/post-author-name/transforms.js
Lines 11 to 13 in 1553653
transform: ( { textAlign } ) => | |
createBlock( 'core/post-author-name', { textAlign } ), | |
}, |
@t-hamano Thanks for highlighting, I have added support for |
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 👍
… number (WordPress#70287) * feat: Add transforms functionality to post-comments-count and post-comments-link blocks * chore: pass textAlign attribute in transforms for post-comments blocks * chore: refactor transform functions to use destructured textAlign attribute Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: draganescu <andraganescu@git.wordpress.org>
What?
Adds bidirectional transform support between Post Comments Link and Post Comments Number blocks.
Closes #53053
Why?
The Post Comments Link and Post Comments Number blocks share similar functionality (both display comment-related information) but currently cannot be transformed into each other. This creates an inconsistent user experience where users need to delete one block and manually recreate the other to switch between displaying a comments link vs. comments count, losing all their styling and configuration in the process.
Testing Instructions
Screenshots or screencast
Comment_transforms.mov