Last active
April 22, 2021 20:22
-
-
Save phpbits/6be9d1db3d90af06ba7b76ec54a8d18d to your computer and use it in GitHub Desktop.
Create Custom Image Block Styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WordPress dependencies | |
*/ | |
const { __ } = wp.i18n; | |
const { registerBlockStyle } = wp.blocks; | |
registerBlockStyle( 'core/image' , { | |
name: 'default', | |
label: __( 'Default' ), | |
isDefault: true, | |
}); | |
registerBlockStyle( 'core/image', { | |
name: 'circular-image', | |
label: __( 'Circular' ), | |
isDefault: false, | |
}); | |
registerBlockStyle( 'core/image', { | |
name: 'rounded-corners', | |
label: __( 'Rounded Corners' ), | |
isDefault: false, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment