PluginProbe ʕ •ᴥ•ʔ
Simple Author Box / 2.52
Simple Author Box v2.52
trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.9 2.0 2.0.1 2.0.2 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.11 2.3.12 2.3.15 2.3.16 2.3.2 2.3.20 2.3.21 2.3.22 2.4 2.41 2.42 2.45 2.46 2.47 2.48 2.49 2.50 2.51 2.52 2.54 2.55 2.56 2.57 2.59 2.60
simple-author-box / assets / src / js / sab_gutenberg_editor_script.js
simple-author-box / assets / src / js Last commit date
components 3 years ago utils 7 years ago sab_gutenberg_editor_script.js 7 years ago
sab_gutenberg_editor_script.js
75 lines
1 import Edit from './components/edit';
2
3 import icons from './utils/icons';
4
5 const { registerBlockType } = wp.blocks;
6
7
8 class SAB_Gutenberg {
9
10 constructor() {
11 this.registerBlock();
12 }
13
14 registerBlock() {
15
16 /**
17 * Block attributes
18 */
19 const blockAttributes = {
20 authorID: {
21 type: 'integer',
22 default: 0,
23 },
24 display_name: {
25 type: 'string',
26 default: '',
27 },
28 avatar: {
29 type: 'string',
30 default: '',
31 },
32 profile_image: {
33 type: 'string',
34 default: '',
35 },
36 description: {
37 type: 'string',
38 default: '',
39 },
40 user_url: {
41 type: 'string',
42 default: '',
43 },
44 social_links: {
45 type: 'array',
46 default: '',
47 },
48 status: {
49 type: 'string',
50 default: 'loading',
51 },
52 };
53
54 registerBlockType( 'simple-author-box/sab', {
55 title: 'Simple Author Box',
56 icon: icons.author,
57 category: 'common',
58 supports: {
59 customClassName: false,
60 },
61 attributes: blockAttributes,
62 edit: Edit,
63 save() {
64 // Rendering in PHP
65 return null;
66 },
67 } );
68
69 }
70
71
72 }
73
74 window.sab = new SAB_Gutenberg();
75