data
6 years ago
edit
6 years ago
class-give-donation-form-block.php
6 years ago
index.js
6 years ago
style.scss
6 years ago
index.js
39 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | const { __ } = wp.i18n; |
| 5 | const { registerBlockType } = wp.blocks; |
| 6 | |
| 7 | /** |
| 8 | * Internal dependencies |
| 9 | */ |
| 10 | import './style.scss'; |
| 11 | import GiveLogo from '../components/logo'; |
| 12 | import blockAttributes from './data/attributes'; |
| 13 | import GiveForm from './edit/block'; |
| 14 | |
| 15 | /** |
| 16 | * Register Block |
| 17 | */ |
| 18 | |
| 19 | export default registerBlockType( 'give/donation-form', { |
| 20 | |
| 21 | title: __( 'Donation Form' ), |
| 22 | description: __( 'The GiveWP Donation Form block inserts an existing donation form into the page. Each donation form\'s presentation can be customized below.' ), |
| 23 | category: 'give', |
| 24 | icon: <GiveLogo color="grey" />, |
| 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 |