css
5 years ago
attributes.js
4 years ago
block.js
4 years ago
deprecated.js
5 years ago
edit.js
4 years ago
editor.scss
5 years ago
save.js
5 years ago
block.js
50 lines
| 1 | /** |
| 2 | * Block: Buttons |
| 3 | */ |
| 4 | |
| 5 | import './editor.scss'; |
| 6 | |
| 7 | import editButton from './edit'; |
| 8 | import saveButton from './save'; |
| 9 | import deprecated from './deprecated'; |
| 10 | import blockAttributes from './attributes'; |
| 11 | import getIcon from '../../utils/get-icon'; |
| 12 | |
| 13 | import { |
| 14 | __, |
| 15 | } from '@wordpress/i18n'; |
| 16 | |
| 17 | import { |
| 18 | registerBlockType, |
| 19 | } from '@wordpress/blocks'; |
| 20 | |
| 21 | /** |
| 22 | * Register our Button block. |
| 23 | * |
| 24 | * @param {string} name Block name. |
| 25 | * @param {Object} settings Block settings. |
| 26 | * @return {?WPBlock} The block, if it has been successfully |
| 27 | * registered; otherwise `undefined`. |
| 28 | */ |
| 29 | registerBlockType( 'generateblocks/button', { |
| 30 | title: __( 'Button', 'generateblocks' ), |
| 31 | description: __( 'Drive conversions with beautiful buttons.', 'generateblocks' ), |
| 32 | parent: [ 'generateblocks/button-container' ], |
| 33 | icon: getIcon( 'button' ), |
| 34 | category: 'generateblocks', |
| 35 | keywords: [ |
| 36 | __( 'button' ), |
| 37 | __( 'buttons' ), |
| 38 | __( 'generate' ), |
| 39 | ], |
| 40 | attributes: blockAttributes, |
| 41 | supports: { |
| 42 | className: false, |
| 43 | inserter: false, |
| 44 | reusable: false, |
| 45 | }, |
| 46 | edit: editButton, |
| 47 | save: saveButton, |
| 48 | deprecated, |
| 49 | } ); |
| 50 |