PluginProbe ʕ •ᴥ•ʔ
Rich Showcase for Google Reviews / 3.1
Rich Showcase for Google Reviews v3.1
6.9.9 6.9.8 6.9.7 6.9.6 trunk 1.4 1.42 1.43 1.44 1.45 1.46 1.47 1.48 1.49 1.5 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.7 1.6.8 1.6.9 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0 2.0.1 2.0.2 2.0.3 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.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.4 2.4.1 2.4.2 2.5 2.5.1 2.6 2.6.1 2.6.2 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.6.1 3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.8.1 4.8.2 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.7.1 5.8 5.9 5.9.1 5.9.2 5.9.3 5.9.7 6.0 6.1 6.2 6.3 6.4 6.4.1 6.5 6.6 6.6.1 6.6.2 6.7 6.8 6.8.1 6.8.2 6.9 6.9.1 6.9.2 6.9.3 6.9.4 6.9.4.1 6.9.4.2 6.9.4.3 6.9.4.4 6.9.5
widget-google-reviews / build / index.js
widget-google-reviews / build Last commit date
index.asset.php 2 years ago index.js 2 years ago index2.js 2 years ago
index.js
71 lines
1 (function(blocks, editor, element, components, api) {
2
3 var el = element.createElement,
4 SelectControl = components.SelectControl,
5 Button = components.Button,
6 __ = wp.i18n.__;
7
8 blocks.registerBlockType('widget-google-reviews/reviews', {
9 title: __('Google Reviews Block', 'widget-google-reviews'),
10 icon: 'star-filled',
11 category: 'widgets',
12 keywords: ['google', 'reviews', 'block'],
13 attributes: {id: {type: 'string'}},
14
15 edit: function(props) {
16
17 var attributes = props.attributes;
18 var blockProps = wp.blockEditor.useBlockProps();
19
20 let feeds = grwBlockData.feeds,
21 options = [{label: __('Select reviews widget'), value: 0}];
22
23 for (let i = 0; i < feeds.length; i++) {
24 options.push({label: feeds[i].name, value: feeds[i].id});
25 }
26
27 return el(
28 'div',
29 blockProps,
30 el(
31 SelectControl,
32 {
33 id: 'id',
34 name: 'id',
35 value: props.attributes.id,
36 options: options,
37 onChange: function(newval) {
38 props.setAttributes({id: newval});
39 }
40 }
41 ),
42 el(
43 Button,
44 {
45 text: __('Edit reviews widget'),
46 href: grwBlockData.builderUrl + '&grw_feed_id=' + props.attributes.id,
47 target: '_blank'
48 }
49 ),
50 el(
51 Button,
52 {
53 text: __('Creat new reviews widget'),
54 href: grwBlockData.builderUrl,
55 target: '_blank'
56 }
57 )
58 );
59 },
60
61 save: function(props) {
62 return null;
63 }
64 });
65 }(
66 window.wp.blocks,
67 window.wp.editor,
68 window.wp.element,
69 window.wp.components,
70 window.wp.api
71 ));