I have a client that wants images to automatically be centered. This used to be possible with the image_default_align
option for the old editor. Is there a simple way to change the default attributes for core blocks?
-
Gutenberg already have a align center option that appears on toolbar. You can add your editor styles via hook for some custom styling.– Mehmood AhmadMar 11, 2019 at 21:19
-
Thanks @MehmoodAhmad I know the center options is there. My clients wants center to be the default for the image block. I would like to change this default attribute.– NateMar 13, 2019 at 1:41
-
I think it can be achievable via Block Filters (developer.wordpress.org/block-editor/developers/filters/…), but I'm not sure. Still working on this myself.– Oksana RomanivNov 16, 2019 at 17:08
Add a comment
|