SiteOrigin Widgets Bundle - Version 1.5.4

Version Description

  • November 18 2015 =
  • Fixed compatibility with PHP 5.2
Download this release

Release Info

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

Code changes from version 1.5.3 to 1.5.4

base/inc/fields/measurement.class.php CHANGED
@@ -11,6 +11,13 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
11
return $input_classes;
12
}
13
14
protected function get_render_values( $value ) {
15
preg_match('/(\d+)([a-z%]+)*/', $value, $matches);
16
$num_matches = count( $matches );
@@ -21,13 +28,13 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
21
}
22
23
protected function render_field( $value, $instance ) {
24
- $num_value = $this->get_render_values($value)['value'];
25
-
26
- parent::render_field( $num_value, $instance );
27
}
28
29
protected function render_after_field( $value, $instance ) {
30
- $unit = $this->get_render_values($value)['unit'];
31
if ( is_null( $unit ) ) {
32
$unit_name = $this->get_unit_field_name( $this->base_name );
33
@@ -35,7 +42,8 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
35
$unit = $instance[ $unit_name ];
36
}
37
else if ( isset( $this->default ) ) {
38
- $unit = $this->get_render_values( $this->default )['unit'];
39
}
40
}
41
?>
@@ -60,8 +68,10 @@ class SiteOrigin_Widget_Field_Measurement extends SiteOrigin_Widget_Field_Text_I
60
protected function sanitize_field_input( $value, $instance ) {
61
//Get the property name of the unit field
62
$unit_name = $this->get_unit_field_name( $this->base_name );
63
//Initialize with default value, if any.
64
- $unit = $this->get_render_values( $this->default )['unit'];
65
if( isset( $instance[ $unit_name ] ) ) {
66
$units = siteorigin_widgets_get_measurements_list();
67
if ( in_array( $instance[ $unit_name ], $units ) ) {
11
return $input_classes;
12
}
13
14
+ /**
15
+ * Parse a value into a unit and value.
16
+ *
17
+ * @param $value
18
+ *
19
+ * @return array
20
+ */
21
protected function get_render_values( $value ) {
22
preg_match('/(\d+)([a-z%]+)*/', $value, $matches);
23
$num_matches = count( $matches );
28
}
29
30
protected function render_field( $value, $instance ) {
31
+ $value_parts = $this->get_render_values($value);
32
+ parent::render_field( $value_parts['value'], $instance );
33
}
34
35
protected function render_after_field( $value, $instance ) {
36
+ $value_parts = $this->get_render_values($value);
37
+ $unit = $value_parts['unit'];
38
if ( is_null( $unit ) ) {
39
$unit_name = $this->get_unit_field_name( $this->base_name );
40
42
$unit = $instance[ $unit_name ];
43
}
44
else if ( isset( $this->default ) ) {
45
+ $default_parts = $this->get_render_values($this->default);
46
+ $unit = $default_parts['unit'];
47
}
48
}
49
?>
68
protected function sanitize_field_input( $value, $instance ) {
69
//Get the property name of the unit field
70
$unit_name = $this->get_unit_field_name( $this->base_name );
71
+
72
//Initialize with default value, if any.
73
+ $default_parts = $this->get_render_values($this->default);
74
+ $unit = $default_parts['unit'];
75
if( isset( $instance[ $unit_name ] ) ) {
76
$units = siteorigin_widgets_get_measurements_list();
77
if ( in_array( $instance[ $unit_name ], $units ) ) {
readme.txt CHANGED
@@ -50,6 +50,9 @@ The SiteOrigin Widgets Bundle is the perfect platform to build widgets for your
50
51
== Changelog ==
52
53
= 1.5.3 - November 17 2015 =
54
* Fixed defaults for Features widget and Hero Image widget.
55
* Fixed previewing for Editor widget.
50
51
== Changelog ==
52
53
+ = 1.5.4 - November 18 2015 =
54
+ * Fixed compatibility with PHP 5.2
55
+
56
= 1.5.3 - November 17 2015 =
57
* Fixed defaults for Features widget and Hero Image widget.
58
* Fixed previewing for Editor widget.
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.5.3
6
Text Domain: so-widgets-bundle
7
Domain Path: /languages
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.5.3');
16
define('SOW_BUNDLE_JS_SUFFIX', '.min');
17
define('SOW_BUNDLE_BASE_FILE', __FILE__);
18
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.5.4
6
Text Domain: so-widgets-bundle
7
Domain Path: /languages
8
Author: SiteOrigin
12
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13
*/
14
15
+ define('SOW_BUNDLE_VERSION', '1.5.4');
16
define('SOW_BUNDLE_JS_SUFFIX', '.min');
17
define('SOW_BUNDLE_BASE_FILE', __FILE__);
18