block.js
2.48 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import './sidebar.js';
import {
moduleIsActive
} from '../utilities';
import {
UncannyOwlIconColor
} from '../components/icons';
import {
ToolkitPlaceholder
} from '../components/editor';
const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
if ( moduleIsActive( `GroupLogoList` ) ){
registerBlockType( 'uncanny-toolkit-pro/group-logo', {
title: __( 'Group Logo', 'uncanny-pro-toolkit' ),
description: __( 'Displays the branding image associated with the current user\'s group. If the user is in more than one group with a branding logo, all logos will be displayed.', 'uncanny-pro-toolkit' ),
icon: UncannyOwlIconColor,
category: 'uncanny-learndash-toolkit',
keywords: [
__('Uncanny Owl'),
],
supports: {
html: false
},
attributes: {
size: {
type: 'string',
default: 'full'
}
},
edit({ className, attributes, setAttributes }){
return (
<div className={className}>
<ToolkitPlaceholder>
{ __( 'Group Logo', 'uncanny-pro-toolkit' ) }
</ToolkitPlaceholder>
</div>
);
},
save({ className, attributes }){
// We're going to render this block using PHP
// Return null
return null;
},
});
registerBlockType( 'uncanny-toolkit-pro/group-list', {
title: __( 'Group List', 'uncanny-pro-toolkit' ),
description: __( 'Displays a list of the groups the current user is a member of.', 'uncanny-pro-toolkit' ),
icon: UncannyOwlIconColor,
category: 'uncanny-learndash-toolkit',
keywords: [
__('Uncanny Owl'),
],
supports: {
html: false
},
attributes: {
separator: {
type: 'string',
default: ', '
}
},
edit({ className, attributes, setAttributes }){
return (
<div className={className}>
<ToolkitPlaceholder>
{ __( 'Group List', 'uncanny-pro-toolkit' ) }
</ToolkitPlaceholder>
</div>
);
},
save({ className, attributes }){
// We're going to render this block using PHP
// Return null
return null;
},
});
}