data
8 years ago
edit
7 years ago
class-give-donation-form-block.php
8 years ago
index.js
8 years ago
style.scss
8 years ago
index.js
39 lines
| 1 | /** |
| 2 | * Block dependencies |
| 3 | */ |
| 4 | import './style.scss'; |
| 5 | import giveLogo from './data/icon'; |
| 6 | import blockAttributes from './data/attributes'; |
| 7 | import GiveForm from './edit/block'; |
| 8 | |
| 9 | /** |
| 10 | * Internal dependencies |
| 11 | */ |
| 12 | const { __ } = wp.i18n; |
| 13 | const { registerBlockType } = wp.blocks; |
| 14 | |
| 15 | /** |
| 16 | * Register Block |
| 17 | */ |
| 18 | |
| 19 | export default registerBlockType( 'give/donation-form', { |
| 20 | |
| 21 | title: __( 'Give Form' ), |
| 22 | description: __( 'The Give Donation Form block insert an existing donation form into the page. Each form\'s presentation can be customized below.' ), |
| 23 | category: 'widgets', |
| 24 | icon: giveLogo, |
| 25 | keywords: [ |
| 26 | __( 'donation' ), |
| 27 | ], |
| 28 | supports: { |
| 29 | html: false, |
| 30 | }, |
| 31 | attributes: blockAttributes, |
| 32 | edit: GiveForm, |
| 33 | |
| 34 | save: () => { |
| 35 | // Server side rendering via shortcode |
| 36 | return null; |
| 37 | }, |
| 38 | } ); |
| 39 |