-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Caption utility component: Allow the main CSS Class Name to be excluded from the markup. #62485
Caption utility component: Allow the main CSS Class Name to be excluded from the markup. #62485
Conversation
…excluded in the HTML markup
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. |
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @aatanasovdev! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
Regarding the failed tests:
|
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 working on this change!
The code looks good to me, but I think the prop naming could be simplified a little.
It doesn't really affect the functionality though, so I'll approve it.
@@ -32,6 +32,7 @@ export function Caption( { | |||
placeholder = __( 'Add caption' ), | |||
label = __( 'Caption text' ), | |||
showToolbarButton = true, | |||
excludeMainElementClassName, |
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.
I think the naming of the prop could be simplified:
excludeMainElementClassName, | |
excludeElementClassName, |
…e for excluding the Element CSS Class Name
@talldan, thank you for approving the change and suggesting a simplified prop name. I've pushed a new commit with the simplified name. |
Thanks @aatanasovdev for your contribution. There's a unit test failure related to the |
…ed from the markup. (WordPress#62485) * Allow the main CSS class name of the Caption utility component to be excluded in the HTML markup * Caption utility component: change the name of the property responsible for excluding the Element CSS Class Name ---- Co-authored-by: aatanasovdev <aatanasov@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
…ed from the markup. (WordPress#62485) * Allow the main CSS class name of the Caption utility component to be excluded in the HTML markup * Caption utility component: change the name of the property responsible for excluding the Element CSS Class Name ---- Co-authored-by: aatanasovdev <aatanasov@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
…ed from the markup. (#62485) * Allow the main CSS class name of the Caption utility component to be excluded in the HTML markup * Caption utility component: change the name of the property responsible for excluding the Element CSS Class Name ---- Co-authored-by: aatanasovdev <aatanasov@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
…ed from the markup. (#62485) * Allow the main CSS class name of the Caption utility component to be excluded in the HTML markup * Caption utility component: change the name of the property responsible for excluding the Element CSS Class Name ---- Co-authored-by: aatanasovdev <aatanasov@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
I just cherry-picked this PR to the wp/6.6-beta-3 branch to get it included in the next release: b6178b7 |
…ed from the markup. (#62485) * Allow the main CSS class name of the Caption utility component to be excluded in the HTML markup * Caption utility component: change the name of the property responsible for excluding the Element CSS Class Name ---- Co-authored-by: aatanasovdev <aatanasov@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
What?
Extending the Caption utility component by allowing the main CSS Class Name to be excluded from the HTML Markup using a prop called
excludeElementClassName
. Also, the Quote block was modified to use the prop.Why?
This update is related to this issue: 62208
The new prop allows us to reuse the existing Caption component in places where its main CSS Class Name (
.wp-element-caption
) isn't needed.How?
It addresses the issue by adding a prop to the Caption component, which excludes the main CSS Class Name when needed.
Testing Instructions
wp-element-caption
CSS Class Name shouldn't exist in the<cite>
element.wp-element-caption
CSS Class Name should exist in the<figcaption>
element.