editor.js 850 B

123456789101112131415161718192021222324252627282930313233
  1. wp.domReady( () => {
  2. const allowedEmbedBlocks = [
  3. 'vimeo','youtube',
  4. ];
  5. wp.blocks.getBlockVariations('core/embed').forEach(function (blockVariation) {
  6. if (-1 === allowedEmbedBlocks.indexOf(blockVariation.name)) {
  7. wp.blocks.unregisterBlockVariation('core/embed', blockVariation.name);
  8. }
  9. });
  10. wp.blocks.unregisterBlockStyle( 'core/button', ['default', 'outline', 'squared', 'fill'] );
  11. wp.blocks.registerBlockStyle( 'core/button', [
  12. {
  13. name: 'bootstrap-outline-secondary',
  14. label: 'Purple Outline',
  15. isDefault: true
  16. },
  17. {
  18. name: 'bootstrap-secondary',
  19. label: 'Purple Solid'
  20. },
  21. {
  22. name: 'bootstrap-outline-primary',
  23. label: 'Green Outline'
  24. },
  25. {
  26. name: 'bootstrap-primary',
  27. label: 'Green Solid'
  28. }
  29. ]
  30. );
  31. });