Skip to content
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

Latest Posts block: use align supports flag + add left/right align support #10707

Closed
wants to merge 2 commits into from
Closed

Latest Posts block: use align supports flag + add left/right align support #10707

wants to merge 2 commits into from

Conversation

ZebulanStanphill
Copy link
Member

@ZebulanStanphill ZebulanStanphill commented Oct 17, 2018

Description

Closes #8777.

(Note that this PR currently contains #10706, which is a blocker for this one due to both modifying the same file. Once that PR is merged, this one will be rebased.)

This PR refactors the Latest Posts block to use the supports: { align } flag and adds support for the left and right alignments to the block. Notably, support for those alignments was already implied by getEditWrapperProps in index.js, but due to mistakes in master, the alignments could not be chosen in the editor. This PR also adds an enum property to the align attribute in index.php to prevent invalid alignment classes from appearing on the front-end.

This PR is pretty much the same as #10706, except it is for the Latest Posts block rather than the Archives block.

Types of changes

  • Using supports: { align } to add block alignment support to the block.
  • Added enum to the align attribute defined in index.php to fix an issue in master where you could set invalid values for the attribute, which would result in invalid classes (e.g. "alignbob") on the front-end.
  • Simplified some string concatenation code in index.php and made it consistent with other blocks (e.g. Archives and Categories blocks).
  • The block attributes defined in index.php were in a random order; now they are in alphabetical order.

Related PRs

@ZebulanStanphill
Copy link
Member Author

Rebased to resolve merge conflicts. Also, I think the bug label may be appropriate for this pull request.

@ZebulanStanphill
Copy link
Member Author

Rebased PR and updated it based on feedback on #10758.

@ZebulanStanphill
Copy link
Member Author

Closing due to the similar PR, #8814, being merged.

@ZebulanStanphill ZebulanStanphill deleted the update/latest-posts-block-align branch February 4, 2019 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Latest Posts Affects the Latest Posts Block [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Latest Posts block: Add float alignment options
3 participants