Set default image alignment
-
Is there some way to make the image block default to center-aligning images?
I have tried overriding the block in JS using the following code and properly enqueued, but the result is I get two alignment buttons in the editor, which cannot be correct?
// Modify settings for Core blocks wp.hooks.addFilter( 'blocks.registerBlockType', 'my/change_alignment', ( settings, name ) => { switch( name ) { case 'core/image': return lodash.assign( {}, settings, { supports: lodash.assign( {}, settings.supports, { align: [ 'center'] } ), } ); } return settings; });
Any help would be appreciated.
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Set default image alignment’ is closed to new replies.