-
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 Archives block alignment and custom class bugs #9696
Fix Archives block alignment and custom class bugs #9696
Conversation
I can't figure out what is going wrong with the tests. Any ideas? |
Fixed the tests. Thanks for the help, @aduth! 🙂 |
Squashed and rebased. Ready for review. |
'align' => array( | ||
'type' => 'string', | ||
), | ||
'className' => array( |
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.
Not certain declaring this one is necessary here because there's a hook adding this attribute. Though one could think the hook is only declared on JavaScript which means nothing guarantees that it's available in PHP (which hopefully the server-side awareness work should resolve)
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 👍 Thanks for the tweaks
Description
This PR fixes two issues:
alignnone
class when no alignment is set, which is inconsistent with other blocks.It also contains some minor code cleanup, reorganizing attributes alphabetically and using
Array.prototype.includes
to check for valid alignments (which is something the Latest Comments block already does), rather than the more verbose and harder-to-read series of||
s.