PluginProbe
Uji Countdown / trunk
Uji Countdown vtrunk
3.0 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.6.1 1.0.7 1.0.8 1.0.9 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 36 releases
uji-countdown / src / block / block.js

block.js in Uji Countdown trunk, at src/block/block.js

75 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * BLOCK: uji-countdown
3 *
4 * Registering a basic block with Gutenberg.
5 * Simple block, renders and saves the same content without any interactivity.
6 */
7
8 // Import CSS.
9
10 //import './editor.scss';
11 //import './style.scss';
12
13 import metadata from './block.json';
14 import edit from './edit';
15 import save from './save';
16 import deprecated from './edit-deprecated'; // Import the old edit function
17
18 const { __ } = wp.i18n; // Import __() from wp.i18n
19 const { registerBlockType } = wp.blocks; // Import registerBlockType() from wp.blocks
20
21 const { name, category, attributes } = metadata;
22
23 /**
24 * Register: aa Gutenberg Block.
25 *
26 * Registers a new block provided a unique name and an object defining its
27 * behavior. Once registered, the block is made editor as an option to any
28 * editor interface where blocks are implemented.
29 *
30 * @link https://wordpress.org/gutenberg/handbook/block-api/
31 * @param {string} name Block name.
32 * @param {Object} settings Block settings.
33 * @return {?WPBlock} The block, if it has been successfully
34 * registered; otherwise `undefined`.
35 */
36 registerBlockType(name, {
37 // Block name. Block names must be string that contains a namespace prefix. Example: my-plugin/my-custom-block.
38 title: __('Uji Countdown'), // Block title.
39 icon: 'clock', // Block icon from Dashicons → https://developer.wordpress.org/resource/dashicons/.
40 category, // Block category — Group blocks together based on common traits E.g. common, formatting, layout widgets, embed.
41 keywords: [__('Uji Countdown'), __('Countdown Timer'), __('uji-countdown')],
42
43 deprecated,
44
45 attributes,
46
47 /**
48 * The edit function describes the structure of your block in the context of the editor.
49 * This represents what the editor will render when the block is used.
50 *
51 * The "edit" property must be a valid function.
52 *
53 * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
54 *
55 * @param {Object} props Props.
56 * @returns {Mixed} JSX Component.
57 */
58 edit,
59
60 /**
61 * The save function defines the way in which the different attributes should be combined
62 * into the final markup, which is then serialized by Gutenberg into post_content.
63 *
64 * The "save" property must be specified and must be a valid function.
65 *
66 * @link https://wordpress.org/gutenberg/handbook/block-api/block-edit-save/
67 *
68 * @param {Object} props Props.
69 * @returns {Mixed} JSX Frontend HTML.
70 */
71 save
72
73
74 });
75