-
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
Add title class name to latest posts Block #32374
Add title class name to latest posts Block #32374
Conversation
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.
Hi @miminari, classes are not part of the public WordPress API and they can be changed or removed. Normally we only add classes when we have a use case for them (as part of the styling core/Gutenberg does) I guess we can add the class if one day we need to use it?
@jorgefilipecosta Thank you for your reply. OK, that is the policy of WordPress, but I don't think it explains why other elements are given classes and why only the title element doesn't need to be styled. Why not? It is uncomfortable. If you try to apply a style to this block in your theme, I'm sure you will feel the same discomfort. And since it's an a tag, you have to be a little careful when you try to give it a style according to "the stylelint". Conversely, why is the class name given to the |
I'm afraid I don't quite understand why this would be necessary... That block doesn't have any text links in it other than the post-titles, so |
@aristath Thank you for reply. What I'm trying to tell you is that the coding rule may be ambiguous. If the rule is to add classes only for the minimum required by the core, then, the class name of the |
The block allows to display the content of the post (either excerpt or full post). So, I believe having |
Hi, thanks for your effort in making this. Since your PR was made, another PR was made and has been merged into Gutenberg that adds the title class name; fulfilling the purpose of your PR. |
Hi @skorasaurus, I know that the PR you referenced is merged but I found that it is wrong, because the class for post title was added on the featured image element instead on the post title element. I've created a new issue for this |
Description
I think the title element of the latest posts Block should contain the class name, just like the author, post date, etc.
related #22759
How has this been tested?
You will see the class name
wp-block-latest-posts__post-title
added to thea
tag of the post title in the editor screen and on the front side using the dev tool.Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).