-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathblock.js
More file actions
executable file
·46 lines (37 loc) · 1.32 KB
/
block.js
File metadata and controls
executable file
·46 lines (37 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* BLOCK: wp-bootstrap-blocks/row
*/
import edit from './edit';
// Import CSS.
import './style.scss';
import './editor.scss';
const { __ } = wp.i18n; // Import __() from wp.i18n
const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
const { InnerBlocks } = wp.editor;
registerBlockType( 'wp-bootstrap-blocks/row', {
// Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
title: __( 'Row', 'wp-bootstrap-blocks' ), // Block title.
icon: 'layout', // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
category: 'wp-bootstrap-blocks', // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
keywords: [
__( 'Bootstrap Blocks', 'wp-bootstrap-blocks' ),
__( 'Bootstrap', 'wp-bootstrap-blocks' ),
__( 'Row', 'wp-bootstrap-blocks' ),
],
supports: {
align: [ 'full' ],
},
// attributes are defined server side with register_block_type(). This is needed to make default attributes available in the blocks render callback.
getEditWrapperProps( attributes ) {
return {
'data-alignment': attributes.alignment,
'data-vertical-alignment': attributes.verticalAlignment,
};
},
edit,
save() {
return (
<InnerBlocks.Content />
);
},
} );