SiteOrigin Widgets Bundle - Version 1.9.9

Version Description

  • 31 August 2017 =
  • Avoid using relative paths in asset URLs.
  • Fixed compat with latest Elementor update.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 SiteOrigin Widgets Bundle
Version 1.9.9
Comparing to
See all releases

Code changes from version 1.9.8 to 1.9.9

admin/tpl/admin.php CHANGED
@@ -2,9 +2,9 @@
2
<div class="page-banner">
3
4
<span class="icon">
5
- <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-back.png" class="icon-back" width="50" height="43">
6
- <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-gear.png" class="icon-gear" width="26" height="26">
7
- <img src="<?php echo plugin_dir_url(__FILE__) ?>../images/icon-front.png" class="icon-front" width="50" height="43">
8
</span>
9
<h1><?php _e('SiteOrigin Widgets Bundle', 'so-widgets-bundle') ?></h1>
10
2
<div class="page-banner">
3
4
<span class="icon">
5
+ <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-back.png' )?>" class="icon-back" width="50" height="43">
6
+ <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-gear.png' ) ?>" class="icon-gear" width="26" height="26">
7
+ <img src="<?php echo siteorigin_widgets_url( 'admin/images/icon-front.png' ) ?>" class="icon-front" width="50" height="43">
8
</span>
9
<h1><?php _e('SiteOrigin Widgets Bundle', 'so-widgets-bundle') ?></h1>
10
base/base.php CHANGED
@@ -239,3 +239,15 @@ function siteorigin_widgets_get_measurements_list() {
239
// Allow themes and plugins to trim or enhance the list.
240
return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
241
}
239
// Allow themes and plugins to trim or enhance the list.
240
return apply_filters('siteorigin_widgets_get_measurements_list', $measurements);
241
}
242
+
243
+
244
+ /**
245
+ * Returns the base URL of our widget with `$path` appended.
246
+ *
247
+ * @param string $path Extra path to append to the end of the URL.
248
+ *
249
+ * @return string Base URL of the widget, with $path appended.
250
+ */
251
+ function siteorigin_widgets_url( $path = '' ) {
252
+ return plugins_url( 'so-widgets-bundle/' . $path );
253
+ }
base/inc/actions.php CHANGED
@@ -27,7 +27,7 @@ function siteorigin_widget_preview_widget_action() {
27
28
// The theme stylesheet will change how the button looks
29
wp_enqueue_style( 'theme-css', get_stylesheet_uri(), array(), rand( 0, 65536 ) );
30
- wp_enqueue_style( 'so-widget-preview', plugin_dir_url( __FILE__ ) . '../css/preview.css', array(), rand( 0,65536 ) );
31
32
$sowb = SiteOrigin_Widgets_Bundle::single();
33
$sowb->register_general_scripts();
27
28
// The theme stylesheet will change how the button looks
29
wp_enqueue_style( 'theme-css', get_stylesheet_uri(), array(), rand( 0, 65536 ) );
30
+ wp_enqueue_style( 'so-widget-preview', siteorigin_widgets_url( 'base/css/preview.css' ), array(), rand( 0,65536 ) );
31
32
$sowb = SiteOrigin_Widgets_Bundle::single();
33
$sowb->register_general_scripts();
compat/elementor/elementor.php CHANGED
@@ -100,7 +100,7 @@ class SiteOrigin_Widgets_Bundle_Elementor {
100
}
101
102
function ajax_render_widget_preview() {
103
-
104
add_filter( 'elementor/widget/render_content', array( $this, 'render_widget_preview' ) );
105
}
106
100
}
101
102
function ajax_render_widget_preview() {
103
+ add_filter( 'siteorigin_widgets_is_preview', '__return_true' );
104
add_filter( 'elementor/widget/render_content', array( $this, 'render_widget_preview' ) );
105
}
106
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
Requires at least: 4.2
4
Tested up to: 4.8.1
5
- Stable tag: 1.9.8
6
- Build time: 2017-08-21T11:15:03+02:00
7
License: GPLv3 or later
8
Contributors: gpriday, braam-genis
9
Donate link: https://siteorigin.com/downloads/contribution/
@@ -54,6 +54,10 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
54
55
== Changelog ==
56
57
= 1.9.8 - 21 August 2017 =
58
* Use WordPress functions to exit AJAX actions.
59
* TinyMCE field: Initialized once.
2
Tags: bundle, widget, button, slider, image, carousel, price table, google maps, tinymce, social links
3
Requires at least: 4.2
4
Tested up to: 4.8.1
5
+ Stable tag: 1.9.9
6
+ Build time: 2017-08-31T10:00:26+02:00
7
License: GPLv3 or later
8
Contributors: gpriday, braam-genis
9
Donate link: https://siteorigin.com/downloads/contribution/
54
55
== Changelog ==
56
57
+ = 1.9.9 - 31 August 2017 =
58
+ * Avoid using relative paths in asset URLs.
59
+ * Fixed compat with latest Elementor update.
60
+
61
= 1.9.8 - 21 August 2017 =
62
* Use WordPress functions to exit AJAX actions.
63
* TinyMCE field: Initialized once.
so-widgets-bundle.php CHANGED
@@ -2,7 +2,7 @@
2
/*
3
Plugin Name: SiteOrigin Widgets Bundle
4
Description: A collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
- Version: 1.9.8
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.9.8');
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 collection of all widgets, neatly bundled into a single plugin. It's also a framework to code your own widgets on top of.
5
+ Version: 1.9.9
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.9.9');
16
define('SOW_BUNDLE_BASE_FILE', __FILE__);
17
18
// Allow JS suffix to be pre-set
widgets/button/button.php CHANGED
@@ -320,46 +320,38 @@ class SiteOrigin_Widget_Button_Widget extends SiteOrigin_Widget {
320
*
321
* @return mixed
322
*/
323
- function modify_instance($instance){
324
-
325
- if( empty($instance['button_icon']) ) {
326
- $instance['button_icon'] = array();
327
-
328
- if(isset($instance['icon_selected'])) $instance['button_icon']['icon_selected'] = $instance['icon_selected'];
329
- if(isset($instance['icon_color'])) $instance['button_icon']['icon_color'] = $instance['icon_color'];
330
- if(isset($instance['icon'])) $instance['button_icon']['icon'] = $instance['icon'];
331
-
332
- unset($instance['icon_selected']);
333
- unset($instance['icon_color']);
334
- unset($instance['icon']);
335
- }
336
-
337
- if( empty($instance['design']) ) {
338
- $instance['design'] = array();
339
-
340
- if(isset($instance['align'])) $instance['design']['align'] = $instance['align'];
341
- if(isset($instance['theme'])) $instance['design']['theme'] = $instance['theme'];
342
- if(isset($instance['button_color'])) $instance['design']['button_color'] = $instance['button_color'];
343
- if(isset($instance['text_color'])) $instance['design']['text_color'] = $instance['text_color'];
344
- if(isset($instance['hover'])) $instance['design']['hover'] = $instance['hover'];
345
- if(isset($instance['font_size'])) $instance['design']['font_size'] = $instance['font_size'];
346
- if(isset($instance['rounding'])) $instance['design']['rounding'] = $instance['rounding'];
347
- if(isset($instance['padding'])) $instance['design']['padding'] = $instance['padding'];
348
-
349
- unset($instance['align']);
350
- unset($instance['theme']);
351
- unset($instance['button_color']);
352
- unset($instance['text_color']);
353
- unset($instance['hover']);
354
- unset($instance['font_size']);
355
- unset($instance['rounding']);
356
- unset($instance['padding']);
357
- }
358
-
359
- if( empty($instance['attributes']) ) {
360
- $instance['attributes'] = array();
361
- if(isset($instance['id'])) $instance['attributes']['id'] = $instance['id'];
362
- unset($instance['id']);
363
}
364
365
return $instance;
320
*
321
* @return mixed
322
*/
323
+ function modify_instance( $instance ) {
324
+ $migrate_props = array(
325
+ 'button_icon' => array(
326
+ 'icon_selected',
327
+ 'icon_color',
328
+ 'icon',
329
+ ),
330
+ 'design' => array(
331
+ 'align',
332
+ 'theme',
333
+ 'button_color',
334
+ 'text_color',
335
+ 'hover',
336
+ 'font_size',
337
+ 'rounding',
338
+ 'padding',
339
+ ),
340
+ 'attributes' => array(
341
+ 'id'
342
+ ),
343
+ );
344
+
345
+ foreach ( $migrate_props as $prop => $sub_props ) {
346
+ if ( empty( $instance[ $prop ] ) ) {
347
+ $instance[ $prop ] = array();
348
+ foreach ( $sub_props as $sub_prop ) {
349
+ if ( isset( $instance[ $sub_prop ] ) ) {
350
+ $instance[ $prop ][ $sub_prop ] = $instance[ $sub_prop ];
351
+ unset( $instance[ $sub_prop ] );
352
+ }
353
+ }
354
+ }
355
}
356
357
return $instance;
widgets/price-table/price-table.php CHANGED
@@ -223,14 +223,16 @@ class SiteOrigin_Widget_PriceTable_Widget extends SiteOrigin_Widget {
223
function get_template_variables( $instance, $args ) {
224
$columns = array();
225
$any_column_has_image = false;
226
- foreach ( $instance['columns'] as $column ) {
227
- $any_column_has_image = $any_column_has_image || ! empty( $column['image'] );
228
- if( ! empty( $column['features'] ) ) {
229
- foreach ( $column['features'] as &$feature ) {
230
- $feature['text'] = do_shortcode( $feature['text'] );
231
}
232
}
233
- $columns[] = $column;
234
}
235
236
return array(
223
function get_template_variables( $instance, $args ) {
224
$columns = array();
225
$any_column_has_image = false;
226
+ if( ! empty( $instance[ 'columns' ] ) ) {
227
+ foreach ( $instance['columns'] as $column ) {
228
+ $any_column_has_image = $any_column_has_image || ! empty( $column['image'] );
229
+ if ( ! empty( $column['features'] ) ) {
230
+ foreach ( $column['features'] as &$feature ) {
231
+ $feature['text'] = do_shortcode( $feature['text'] );
232
+ }
233
}
234
+ $columns[] = $column;
235
}
236
}
237
238
return array(
widgets/slider/slider.php CHANGED
@@ -192,7 +192,7 @@ class SiteOrigin_Widget_Slider_Widget extends SiteOrigin_Widget_Base_Slider {
192
}
193
194
function get_template_variables( $instance, $args ) {
195
- $frames = $instance['frames'];
196
if ( ! empty( $frames ) ) {
197
foreach ( $frames as &$frame ) {
198
$link_atts = array();
@@ -204,7 +204,7 @@ class SiteOrigin_Widget_Slider_Widget extends SiteOrigin_Widget_Base_Slider {
204
}
205
return array(
206
'controls' => $instance['controls'],
207
- 'frames' => empty( $frames ) ? array() : $frames,
208
);
209
}
210
192
}
193
194
function get_template_variables( $instance, $args ) {
195
+ $frames = empty( $instance['frames'] ) ? array() : $instance['frames'];
196
if ( ! empty( $frames ) ) {
197
foreach ( $frames as &$frame ) {
198
$link_atts = array();
204
}
205
return array(
206
'controls' => $instance['controls'],
207
+ 'frames' => $frames,
208
);
209
}
210