-
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
[Fix] Make sure Latest Posts alignment class behaviour #8847
[Fix] Make sure Latest Posts alignment class behaviour #8847
Conversation
…ignment is selected
Thinking about the original issue, if it was really intentional for center to be default, and how we'd support "unsetting" that value, I think if that was something we'd want to support, we could do so by setting the alignment to This, of course, is a non-issue after these changes. |
Totally unrelated to the changes here, but the alignment implementation doesn't work so well on lots of themes, where |
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.
Looks good 👍
Failing test was legitimate. |
Thank you so much for the correction and merge @aduth ❤️ |
@aduth Any idea why we don't use That would, of course, require us to wrap the list up with a |
@nfmohit-wpmudev A few things:
|
Got it, thank you so much for the explanation @aduth ❤️ |
Description
This PR closes #7911 which reports the incorrect behavior of the alignment classes in the Latest Posts block, where it applies alignment classes even if no alignment was selected. It also gets rids of the behavior where the center alignment is selected by default.
How has this been tested?
This PR has been tested by going through the following steps:
This was tested in WP 4.9.8, Gutenberg 3.5.0, Apache server with PHP 7.2.0 and MySQL 5.6.34. According to initial tests, the code doesn’t seem to affect any other areas.
Screenshots
Types of changes
This PR introduces a conditional before applying the alignment classes to make sure an alignment is selected in the first place. It also removes the
default
property from thealign
attribute, so that the center alignment isn't selected and applied by default.Checklist: