Update core/image block to use align supports #13780
Labels
[Block] Image
Affects the Image Block
[Feature] Media
Anything that impacts the experience of managing media
[Priority] Low
Used to indicate that the issue at hand isn't a top priority to address and can be handled later
[Type] Enhancement
A suggestion for improvement.
Is your feature request related to a problem? Please describe.
Several core blocks now use the
align
supports approach to block alignments (center
,wide
,full
, etc..), allowing consistent controls and filtering of what alignments are allowed (or if they're allowed at all). But in adjusting these on a site I found that thecore/image
block still includes theBlockAlignmentToolbar
itself, with a hard-coded array of alignments that make it impossible to filter externally. Trying to set thealign
supports value results in twoBlockAlignmentToolbar
s being added to the block (the smaller group is the custom set I provided, removingleft
andright
options):Describe the solution you'd like
Ideally the
core/image
block uses the alignment hooks approach implemented across other blocks likecore/cover
,core/table
, etc.. so developers (plugin/theme/etc..) can modify them as needed, in a manner consistent with other blocks.Describe alternatives you've considered
There really aren't many alternatives, since the hooks approach has already been implemented across many other blocks as a standard approach, and currently there isn't another way to change Image alignment options without monkey-patching Gutenberg or a rather complex series of BlockEdit filters (in theory, not sure that would even work).
The text was updated successfully, but these errors were encountered: