Version Description
- 22 February 2022 =
- Widgets Block: Prevented a potential notice within the WP admin.
Download this release
Release Info
Developer | SiteOrigin |
Plugin | SiteOrigin Widgets Bundle |
Version | 1.30.1 |
Comparing to | |
See all releases |
Code changes from version 1.30.0 to 1.30.1
- compat/block-editor/widget-block.php +1 -1
- readme.txt +5 -2
- so-widgets-bundle.php +2 -2
- widgets/testimonial/testimonial.php +50 -50
compat/block-editor/widget-block.php
CHANGED
@@ -30,7 +30,7 @@ class SiteOrigin_Widgets_Bundle_Widget_Block {
|
|
30 |
plugins_url( 'widget-block' . SOW_BUNDLE_JS_SUFFIX . '.js', __FILE__ ),
|
31 |
array(
|
32 |
// The WP 5.8 Widget Area requires a specific editor script to be used.
|
33 |
-
|
34 |
'wp-blocks',
|
35 |
'wp-i18n',
|
36 |
'wp-element',
|
30 |
plugins_url( 'widget-block' . SOW_BUNDLE_JS_SUFFIX . '.js', __FILE__ ),
|
31 |
array(
|
32 |
// The WP 5.8 Widget Area requires a specific editor script to be used.
|
33 |
+
is_object( $current_screen ) && $current_screen->base == 'widgets' ? 'wp-edit-widgets' : 'wp-editor',
|
34 |
'wp-blocks',
|
35 |
'wp-i18n',
|
36 |
'wp-element',
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Tags: widget, button, slider, hero, google maps, image, carousel, features, icon
|
|
3 |
Requires at least: 4.2
|
4 |
Tested up to: 5.9
|
5 |
Requires PHP: 5.6.20
|
6 |
-
Stable tag: 1.30.
|
7 |
-
Build time: 2022-02-
|
8 |
License: GPLv3 or later
|
9 |
Contributors: gpriday, braam-genis, alexgso
|
10 |
Donate link: https://siteorigin.com/downloads/premium/
|
@@ -100,6 +100,9 @@ The Widgets Bundle global interface is available at Plugins > SiteOrigin Widgets
|
|
100 |
|
101 |
== Changelog ==
|
102 |
|
|
|
|
|
|
|
103 |
= 1.30.0 - 14 February 2022 =
|
104 |
* Button and Contact Form: Migrated `onclick` to `on_click` to avoid a Worfence flag.
|
105 |
* Call To Action: Remove `Use default background colors` setting.
|
3 |
Requires at least: 4.2
|
4 |
Tested up to: 5.9
|
5 |
Requires PHP: 5.6.20
|
6 |
+
Stable tag: 1.30.1
|
7 |
+
Build time: 2022-02-22T21:33:13+02:00
|
8 |
License: GPLv3 or later
|
9 |
Contributors: gpriday, braam-genis, alexgso
|
10 |
Donate link: https://siteorigin.com/downloads/premium/
|
100 |
|
101 |
== Changelog ==
|
102 |
|
103 |
+
= 1.30.1 - 22 February 2022 =
|
104 |
+
* Widgets Block: Prevented a potential notice within the WP admin.
|
105 |
+
|
106 |
= 1.30.0 - 14 February 2022 =
|
107 |
* Button and Contact Form: Migrated `onclick` to `on_click` to avoid a Worfence flag.
|
108 |
* Call To Action: Remove `Use default background colors` setting.
|
so-widgets-bundle.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
|
5 |
-
Version: 1.30.
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /lang
|
8 |
Author: SiteOrigin
|
@@ -12,7 +12,7 @@ License: GPL3
|
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
-
define( 'SOW_BUNDLE_VERSION', '1.30.
|
16 |
define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
|
17 |
|
18 |
// Allow JS suffix to be pre-set.
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
|
5 |
+
Version: 1.30.1
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /lang
|
8 |
Author: SiteOrigin
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
+
define( 'SOW_BUNDLE_VERSION', '1.30.1' );
|
16 |
define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
|
17 |
|
18 |
// Allow JS suffix to be pre-set.
|
widgets/testimonial/testimonial.php
CHANGED
@@ -12,9 +12,9 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
12 |
function __construct() {
|
13 |
parent::__construct(
|
14 |
'sow-testimonials',
|
15 |
-
__('SiteOrigin Testimonials', 'so-widgets-bundle'),
|
16 |
array(
|
17 |
-
'description' => __('Share your product or service testimonials in a variety of different ways.', 'so-widgets-bundle'),
|
18 |
'help' => 'https://siteorigin.com/widgets-bundle/testimonial-widget-documentation/'
|
19 |
),
|
20 |
array(
|
@@ -25,7 +25,7 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
25 |
);
|
26 |
}
|
27 |
|
28 |
-
function initialize(){
|
29 |
$this->register_frontend_styles( array(
|
30 |
array(
|
31 |
'sow-testimonial',
|
@@ -34,11 +34,11 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
34 |
) );
|
35 |
}
|
36 |
|
37 |
-
function get_widget_form(){
|
38 |
return array(
|
39 |
'title' => array(
|
40 |
'type' => 'text',
|
41 |
-
'label' => __('Title', 'so-widgets-bundle'),
|
42 |
),
|
43 |
'testimonials' => array(
|
44 |
'type' => 'repeater',
|
@@ -52,53 +52,53 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
52 |
'fields' => array(
|
53 |
'name' => array(
|
54 |
'type' => 'text',
|
55 |
-
'label' => __('Name', 'so-widgets-bundle'),
|
56 |
-
'description' => __('The author of the testimonial', 'so-widgets-bundle'),
|
57 |
),
|
58 |
|
59 |
'link_name' => array(
|
60 |
'type' => 'checkbox',
|
61 |
-
'label' => __('Link name', 'so-widgets-bundle'),
|
62 |
),
|
63 |
|
64 |
'location' => array(
|
65 |
'type' => 'text',
|
66 |
-
'label' => __('Location', 'so-widgets-bundle'),
|
67 |
-
'description' => __('Their location or company name', 'so-widgets-bundle'),
|
68 |
),
|
69 |
|
70 |
'image' => array(
|
71 |
'type' => 'media',
|
72 |
-
'label' => __('Image', 'so-widgets-bundle'),
|
73 |
'fallback' => true,
|
74 |
),
|
75 |
|
76 |
'link_image' => array(
|
77 |
'type' => 'checkbox',
|
78 |
-
'label' => __('Link image', 'so-widgets-bundle'),
|
79 |
),
|
80 |
|
81 |
'text' => array(
|
82 |
'type' => 'tinymce',
|
83 |
-
'label' => __('Text', 'so-widgets-bundle'),
|
84 |
-
'description' => __('What your customer had to say', 'so-widgets-bundle'),
|
85 |
),
|
86 |
|
87 |
'url' => array(
|
88 |
'type' => 'text',
|
89 |
-
'label' => __('URL', 'so-widgets-bundle'),
|
90 |
),
|
91 |
|
92 |
'new_window' => array(
|
93 |
'type' => 'checkbox',
|
94 |
-
'label' => __('Open in a new window', 'so-widgets-bundle'),
|
95 |
),
|
96 |
)
|
97 |
),
|
98 |
|
99 |
'settings' => array(
|
100 |
'type' => 'section',
|
101 |
-
'label' => __('Settings', 'so-widgets-bundle'),
|
102 |
'fields' => array(
|
103 |
|
104 |
'per_line' => array(
|
@@ -112,12 +112,12 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
112 |
|
113 |
'responsive' => array(
|
114 |
'type' => 'section',
|
115 |
-
'label' => __('Responsive', 'so-widgets-bundle'),
|
116 |
'hide' => true,
|
117 |
'fields' => array(
|
118 |
'tablet' => array(
|
119 |
'type' => 'section',
|
120 |
-
'label' => __('Tablet', 'so-widgets-bundle'),
|
121 |
'fields' => array(
|
122 |
'per_line' => array(
|
123 |
'type' => 'slider',
|
@@ -146,7 +146,7 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
146 |
),
|
147 |
'mobile' => array(
|
148 |
'type' => 'section',
|
149 |
-
'label' => __('Mobile Phone', 'so-widgets-bundle'),
|
150 |
'fields' => array(
|
151 |
'per_line' => array(
|
152 |
'type' => 'slider',
|
@@ -181,26 +181,26 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
181 |
|
182 |
'design' => array(
|
183 |
'type' => 'section',
|
184 |
-
'label' => __('Design', 'so-widgets-bundle'),
|
185 |
'fields' => array(
|
186 |
|
187 |
'image' => array(
|
188 |
'type' => 'section',
|
189 |
-
'label' => __('Image', 'so-widgets-bundle'),
|
190 |
'fields' => array(
|
191 |
'image_shape' => array(
|
192 |
'type' => 'select',
|
193 |
-
'label' => __('Image shape', 'so-widgets-bundle'),
|
194 |
'options' => array(
|
195 |
-
'square' => __('Square', 'so-widgets-bundle'),
|
196 |
-
'round' => __('Round', 'so-widgets-bundle'),
|
197 |
),
|
198 |
'default' => 'square',
|
199 |
),
|
200 |
|
201 |
'image_size' => array(
|
202 |
'type' => 'slider',
|
203 |
-
'label' => __('Image size', 'so-widgets-bundle'),
|
204 |
'integer' => true,
|
205 |
'default' => 50,
|
206 |
'max' => 150,
|
@@ -211,20 +211,20 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
211 |
|
212 |
'colors' => array(
|
213 |
'type' => 'section',
|
214 |
-
'label' => __('Colors', 'so-widgets-bundle'),
|
215 |
'fields' => array(
|
216 |
'testimonial_background' => array(
|
217 |
'type' => 'color',
|
218 |
-
'label' => __('Widget background', 'so-widgets-bundle'),
|
219 |
),
|
220 |
'text_background' => array(
|
221 |
'type' => 'color',
|
222 |
-
'label' => __('Text background', 'so-widgets-bundle'),
|
223 |
'default' => '#f0f0f0',
|
224 |
),
|
225 |
'text_color' => array(
|
226 |
'type' => 'color',
|
227 |
-
'label' => __('Text color', 'so-widgets-bundle'),
|
228 |
'default' => '#444444',
|
229 |
),
|
230 |
),
|
@@ -232,7 +232,7 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
232 |
|
233 |
'padding' => array(
|
234 |
'type' => 'slider',
|
235 |
-
'label' => __('Padding', 'so-widgets-bundle'),
|
236 |
'integer' => true,
|
237 |
'default' => 10,
|
238 |
'max' => 100,
|
@@ -250,38 +250,38 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
250 |
|
251 |
'user_position' => array(
|
252 |
'type' => 'select',
|
253 |
-
'label' => __('User position', 'so-widgets-bundle'),
|
254 |
'options' => array(
|
255 |
-
'left' => __('Left', 'so-widgets-bundle'),
|
256 |
-
'right' => __('Right', 'so-widgets-bundle'),
|
257 |
-
'middle' => __('Middle', 'so-widgets-bundle'),
|
258 |
),
|
259 |
'default' => 'left',
|
260 |
),
|
261 |
|
262 |
'layout' => array(
|
263 |
'type' => 'select',
|
264 |
-
'label' => __('Testimonial layout', 'so-widgets-bundle'),
|
265 |
'options' => array(
|
266 |
-
'side' => __('Side by side', 'so-widgets-bundle'),
|
267 |
-
'text_above' => __('Text above user', 'so-widgets-bundle'),
|
268 |
-
'text_below' => __('Text below user', 'so-widgets-bundle'),
|
269 |
),
|
270 |
'default' => 'side',
|
271 |
),
|
272 |
|
273 |
'equalize_testimonial_height' => array(
|
274 |
'type' => 'checkbox',
|
275 |
-
'label' => __('Equalize testimonial height', 'so-widgets-bundle'),
|
276 |
),
|
277 |
),
|
278 |
),
|
279 |
);
|
280 |
}
|
281 |
|
282 |
-
function caret_svg(){
|
283 |
static $done = false;
|
284 |
-
if( $done ) return;
|
285 |
|
286 |
?>
|
287 |
<svg style="position: absolute; width: 0; height: 0;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
@@ -308,7 +308,7 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
308 |
$done = true;
|
309 |
}
|
310 |
|
311 |
-
function get_less_variables( $instance ){
|
312 |
if ( empty( $instance ) ) {
|
313 |
return array();
|
314 |
}
|
@@ -319,12 +319,12 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
319 |
'testimonial_background' => $instance['design']['colors']['testimonial_background'],
|
320 |
'equalize_testimonial_height' => ! empty( $instance['design']['equalize_testimonial_height'] ) ? 'true' : 'false',
|
321 |
|
322 |
-
// The text block
|
323 |
'text_border_radius' => (int) $instance['design']['border_radius'] . 'px',
|
324 |
'text_background' => $instance['design']['colors']['text_background'],
|
325 |
'text_color' => $instance['design']['colors']['text_color'],
|
326 |
|
327 |
-
// All the responsive sizes
|
328 |
'tablet_testimonial_size' => round(100/$instance['settings']['responsive']['tablet']['per_line'], 4) . '%',
|
329 |
'tablet_image_size' => (int) $instance['settings']['responsive']['tablet']['image_size'] . 'px',
|
330 |
'tablet_width' => (int) $instance['settings']['responsive']['tablet']['width'] . 'px',
|
@@ -334,7 +334,7 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
334 |
);
|
335 |
}
|
336 |
|
337 |
-
function get_template_variables( $instance, $args ){
|
338 |
return array(
|
339 |
'testimonials' => !empty($instance['testimonials']) ? $instance['testimonials'] : array(),
|
340 |
'settings' => $instance['settings'],
|
@@ -342,7 +342,7 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
342 |
);
|
343 |
}
|
344 |
|
345 |
-
function testimonial_user_image( $image_id, $design, $image_fallback = false ){
|
346 |
$src = siteorigin_widgets_get_attachment_image_src(
|
347 |
$image_id,
|
348 |
$design['image']['image_size'],
|
@@ -353,16 +353,16 @@ class SiteOrigin_Widgets_Testimonials_Widget extends SiteOrigin_Widget {
|
|
353 |
if ( $design['image']['image_shape'] == 'square' ) {
|
354 |
return '<img src="' . esc_url( $src[0] ) . '" class="sow-image-shape-' . $design['image']['image_shape'] . '">';
|
355 |
} else {
|
356 |
-
return '<div class="sow-round-image-frame" style="background-image: url(' . esc_url( $src[0] ) . ');"></div>';
|
357 |
}
|
358 |
}
|
359 |
}
|
360 |
|
361 |
-
function testimonial_pointer( $design ){
|
362 |
|
363 |
}
|
364 |
|
365 |
-
function testimonial_wrapper_class($design){
|
366 |
$classes = array();
|
367 |
$classes[] = 'sow-user-' . sanitize_html_class( $design['user_position'] );
|
368 |
$classes[] = 'sow-layout-' . sanitize_html_class( $design['layout'] );
|
12 |
function __construct() {
|
13 |
parent::__construct(
|
14 |
'sow-testimonials',
|
15 |
+
__( 'SiteOrigin Testimonials', 'so-widgets-bundle' ),
|
16 |
array(
|
17 |
+
'description' => __( 'Share your product or service testimonials in a variety of different ways.', 'so-widgets-bundle' ),
|
18 |
'help' => 'https://siteorigin.com/widgets-bundle/testimonial-widget-documentation/'
|
19 |
),
|
20 |
array(
|
25 |
);
|
26 |
}
|
27 |
|
28 |
+
function initialize() {
|
29 |
$this->register_frontend_styles( array(
|
30 |
array(
|
31 |
'sow-testimonial',
|
34 |
) );
|
35 |
}
|
36 |
|
37 |
+
function get_widget_form() {
|
38 |
return array(
|
39 |
'title' => array(
|
40 |
'type' => 'text',
|
41 |
+
'label' => __( 'Title', 'so-widgets-bundle' ),
|
42 |
),
|
43 |
'testimonials' => array(
|
44 |
'type' => 'repeater',
|
52 |
'fields' => array(
|
53 |
'name' => array(
|
54 |
'type' => 'text',
|
55 |
+
'label' => __( 'Name', 'so-widgets-bundle' ),
|
56 |
+
'description' => __( 'The author of the testimonial', 'so-widgets-bundle' ),
|
57 |
),
|
58 |
|
59 |
'link_name' => array(
|
60 |
'type' => 'checkbox',
|
61 |
+
'label' => __( 'Link name', 'so-widgets-bundle' ),
|
62 |
),
|
63 |
|
64 |
'location' => array(
|
65 |
'type' => 'text',
|
66 |
+
'label' => __( 'Location', 'so-widgets-bundle' ),
|
67 |
+
'description' => __( 'Their location or company name', 'so-widgets-bundle' ),
|
68 |
),
|
69 |
|
70 |
'image' => array(
|
71 |
'type' => 'media',
|
72 |
+
'label' => __( 'Image', 'so-widgets-bundle' ),
|
73 |
'fallback' => true,
|
74 |
),
|
75 |
|
76 |
'link_image' => array(
|
77 |
'type' => 'checkbox',
|
78 |
+
'label' => __( 'Link image', 'so-widgets-bundle' ),
|
79 |
),
|
80 |
|
81 |
'text' => array(
|
82 |
'type' => 'tinymce',
|
83 |
+
'label' => __( 'Text', 'so-widgets-bundle' ),
|
84 |
+
'description' => __( 'What your customer had to say', 'so-widgets-bundle' ),
|
85 |
),
|
86 |
|
87 |
'url' => array(
|
88 |
'type' => 'text',
|
89 |
+
'label' => __( 'URL', 'so-widgets-bundle' ),
|
90 |
),
|
91 |
|
92 |
'new_window' => array(
|
93 |
'type' => 'checkbox',
|
94 |
+
'label' => __( 'Open in a new window', 'so-widgets-bundle' ),
|
95 |
),
|
96 |
)
|
97 |
),
|
98 |
|
99 |
'settings' => array(
|
100 |
'type' => 'section',
|
101 |
+
'label' => __( 'Settings', 'so-widgets-bundle' ),
|
102 |
'fields' => array(
|
103 |
|
104 |
'per_line' => array(
|
112 |
|
113 |
'responsive' => array(
|
114 |
'type' => 'section',
|
115 |
+
'label' => __( 'Responsive', 'so-widgets-bundle' ),
|
116 |
'hide' => true,
|
117 |
'fields' => array(
|
118 |
'tablet' => array(
|
119 |
'type' => 'section',
|
120 |
+
'label' => __( 'Tablet', 'so-widgets-bundle' ),
|
121 |
'fields' => array(
|
122 |
'per_line' => array(
|
123 |
'type' => 'slider',
|
146 |
),
|
147 |
'mobile' => array(
|
148 |
'type' => 'section',
|
149 |
+
'label' => __( 'Mobile Phone', 'so-widgets-bundle' ),
|
150 |
'fields' => array(
|
151 |
'per_line' => array(
|
152 |
'type' => 'slider',
|
181 |
|
182 |
'design' => array(
|
183 |
'type' => 'section',
|
184 |
+
'label' => __( 'Design', 'so-widgets-bundle' ),
|
185 |
'fields' => array(
|
186 |
|
187 |
'image' => array(
|
188 |
'type' => 'section',
|
189 |
+
'label' => __( 'Image', 'so-widgets-bundle' ),
|
190 |
'fields' => array(
|
191 |
'image_shape' => array(
|
192 |
'type' => 'select',
|
193 |
+
'label' => __( 'Image shape', 'so-widgets-bundle' ),
|
194 |
'options' => array(
|
195 |
+
'square' => __( 'Square', 'so-widgets-bundle' ),
|
196 |
+
'round' => __( 'Round', 'so-widgets-bundle' ),
|
197 |
),
|
198 |
'default' => 'square',
|
199 |
),
|
200 |
|
201 |
'image_size' => array(
|
202 |
'type' => 'slider',
|
203 |
+
'label' => __( 'Image size', 'so-widgets-bundle' ),
|
204 |
'integer' => true,
|
205 |
'default' => 50,
|
206 |
'max' => 150,
|
211 |
|
212 |
'colors' => array(
|
213 |
'type' => 'section',
|
214 |
+
'label' => __( 'Colors', 'so-widgets-bundle' ),
|
215 |
'fields' => array(
|
216 |
'testimonial_background' => array(
|
217 |
'type' => 'color',
|
218 |
+
'label' => __( 'Widget background', 'so-widgets-bundle' ),
|
219 |
),
|
220 |
'text_background' => array(
|
221 |
'type' => 'color',
|
222 |
+
'label' => __( 'Text background', 'so-widgets-bundle' ),
|
223 |
'default' => '#f0f0f0',
|
224 |
),
|
225 |
'text_color' => array(
|
226 |
'type' => 'color',
|
227 |
+
'label' => __( 'Text color', 'so-widgets-bundle' ),
|
228 |
'default' => '#444444',
|
229 |
),
|
230 |
),
|
232 |
|
233 |
'padding' => array(
|
234 |
'type' => 'slider',
|
235 |
+
'label' => __( 'Padding', 'so-widgets-bundle' ),
|
236 |
'integer' => true,
|
237 |
'default' => 10,
|
238 |
'max' => 100,
|
250 |
|
251 |
'user_position' => array(
|
252 |
'type' => 'select',
|
253 |
+
'label' => __( 'User position', 'so-widgets-bundle' ),
|
254 |
'options' => array(
|
255 |
+
'left' => __( 'Left', 'so-widgets-bundle' ),
|
256 |
+
'right' => __( 'Right', 'so-widgets-bundle' ),
|
257 |
+
'middle' => __( 'Middle', 'so-widgets-bundle' ),
|
258 |
),
|
259 |
'default' => 'left',
|
260 |
),
|
261 |
|
262 |
'layout' => array(
|
263 |
'type' => 'select',
|
264 |
+
'label' => __( 'Testimonial layout', 'so-widgets-bundle' ),
|
265 |
'options' => array(
|
266 |
+
'side' => __( 'Side by side', 'so-widgets-bundle' ),
|
267 |
+
'text_above' => __( 'Text above user', 'so-widgets-bundle' ),
|
268 |
+
'text_below' => __( 'Text below user', 'so-widgets-bundle' ),
|
269 |
),
|
270 |
'default' => 'side',
|
271 |
),
|
272 |
|
273 |
'equalize_testimonial_height' => array(
|
274 |
'type' => 'checkbox',
|
275 |
+
'label' => __( 'Equalize testimonial height', 'so-widgets-bundle' ),
|
276 |
),
|
277 |
),
|
278 |
),
|
279 |
);
|
280 |
}
|
281 |
|
282 |
+
function caret_svg() {
|
283 |
static $done = false;
|
284 |
+
if ( $done ) return;
|
285 |
|
286 |
?>
|
287 |
<svg style="position: absolute; width: 0; height: 0;" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
308 |
$done = true;
|
309 |
}
|
310 |
|
311 |
+
function get_less_variables( $instance ) {
|
312 |
if ( empty( $instance ) ) {
|
313 |
return array();
|
314 |
}
|
319 |
'testimonial_background' => $instance['design']['colors']['testimonial_background'],
|
320 |
'equalize_testimonial_height' => ! empty( $instance['design']['equalize_testimonial_height'] ) ? 'true' : 'false',
|
321 |
|
322 |
+
// The text block.
|
323 |
'text_border_radius' => (int) $instance['design']['border_radius'] . 'px',
|
324 |
'text_background' => $instance['design']['colors']['text_background'],
|
325 |
'text_color' => $instance['design']['colors']['text_color'],
|
326 |
|
327 |
+
// All the responsive sizes.
|
328 |
'tablet_testimonial_size' => round(100/$instance['settings']['responsive']['tablet']['per_line'], 4) . '%',
|
329 |
'tablet_image_size' => (int) $instance['settings']['responsive']['tablet']['image_size'] . 'px',
|
330 |
'tablet_width' => (int) $instance['settings']['responsive']['tablet']['width'] . 'px',
|
334 |
);
|
335 |
}
|
336 |
|
337 |
+
function get_template_variables( $instance, $args ) {
|
338 |
return array(
|
339 |
'testimonials' => !empty($instance['testimonials']) ? $instance['testimonials'] : array(),
|
340 |
'settings' => $instance['settings'],
|
342 |
);
|
343 |
}
|
344 |
|
345 |
+
function testimonial_user_image( $image_id, $design, $image_fallback = false ) {
|
346 |
$src = siteorigin_widgets_get_attachment_image_src(
|
347 |
$image_id,
|
348 |
$design['image']['image_size'],
|
353 |
if ( $design['image']['image_shape'] == 'square' ) {
|
354 |
return '<img src="' . esc_url( $src[0] ) . '" class="sow-image-shape-' . $design['image']['image_shape'] . '">';
|
355 |
} else {
|
356 |
+
return '<div class="sow-round-image-frame" style="background-image: url( ' . esc_url( $src[0] ) . ' );"></div>';
|
357 |
}
|
358 |
}
|
359 |
}
|
360 |
|
361 |
+
function testimonial_pointer( $design ) {
|
362 |
|
363 |
}
|
364 |
|
365 |
+
function testimonial_wrapper_class( $design ) {
|
366 |
$classes = array();
|
367 |
$classes[] = 'sow-user-' . sanitize_html_class( $design['user_position'] );
|
368 |
$classes[] = 'sow-layout-' . sanitize_html_class( $design['layout'] );
|