block-variations.js 535 B

1234567891011121314151617181920212223
  1. /**
  2. * File block-variations.js
  3. *
  4. * Adds block variation options for blocks in the new editor.
  5. *
  6. */
  7. // Image Block - Since this block doesn't have core block variations, add a 'default' so the "fancy" option can be turned off.
  8. wp.blocks.registerBlockStyle( 'core/image', {
  9. isDefault: true,
  10. label: 'Default'
  11. } );
  12. // Image Block - Add a 'fancy' class, to match theme's existing "framed" style.
  13. wp.blocks.registerBlockStyle( 'core/image', {
  14. name: 'fancy', // Class will be turned into '.is-style-fancy'
  15. label: 'Fancy'
  16. } );