PluginProbe
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels / 1.3.0
Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels v1.3.0
2.9.1 2.9.0 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 2.0.0 2.1.0 2.2.0 2.3.2 2.3.3 2.3.5 2.3.6 2.3.8 2.3.9 2.4.3 All 37 releases
automatic-youtube-gallery / block / src / block / helper.js

helper.js in Automatic YouTube Gallery – Embed Auto-Updating YouTube Video Galleries, Feeds, Playlists & Channels 1.3.0, at block/src/block/helper.js

50 lines 739 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Helper Functions
3 */
4
5 /**
6 * Get block attributes
7 *
8 * @since 1.0.0
9 */
10 export function getAttributes() {
11 var attributes = {
12 is_admin: {
13 type: 'boolean',
14 default: false
15 }
16 };
17
18 for ( var key in ayg_block.options ) {
19 var fields = ayg_block.options[ key ].fields;
20
21 for ( var field in fields ) {
22 var name = fields[ field ].name;
23
24 attributes[ name ] = {
25 type: getAttributeType( fields[ field ].type ),
26 default: fields[ field ].value
27 };
28 }
29 }
30
31 return attributes;
32 }
33
34 /**
35 * Get attribute type
36 *
37 * @since 1.0.0
38 */
39 function getAttributeType( type ) {
40 var _type = 'string';
41
42 if ( 'number' == type ) {
43 _type = 'number';
44 } else if ( 'checkbox' == type ) {
45 _type = 'boolean';
46 }
47
48 return _type;
49 }
50