Page Builder by SiteOrigin - Version 2.5.5

Version Description

  • 8 June 2017 =
  • Ensure form fields name attributes are correct when using the Widgets Bundle post loop helper.
  • Prevent display of unimplemented preview button for Post Loop widget.
Download this release

Release Info

Developer gpriday
Plugin Icon 128x128 Page Builder by SiteOrigin
Version 2.5.5
Comparing to
See all releases

Code changes from version 2.5.4 to 2.5.5

inc/widgets/post-loop-helper.php CHANGED
@@ -29,6 +29,7 @@ class SiteOrigin_Panels_Widgets_PostLoop_Helper extends SiteOrigin_Widget {
29
  __( 'Post Loop', 'siteorigin-panels' ),
30
  array(
31
  'description' => __( 'Displays a post loop.', 'siteorigin-panels' ),
 
32
  ),
33
  array(),
34
  array(
@@ -66,14 +67,14 @@ class SiteOrigin_Panels_Widgets_PostLoop_Helper extends SiteOrigin_Widget {
66
  */
67
  function modify_instance( $instance ) {
68
  if( ! empty( $instance['post_type'] ) ) {
69
- $value = '';
70
 
71
- if( ! empty( $instance['post_type'] ) ) $value .= 'post_type=' . $instance['post_type'];
72
- if( ! empty( $instance['posts_per_page'] ) ) $value .= '&posts_per_page=' . $instance['posts_per_page'];
73
- if( ! empty( $instance['order'] ) ) $value .= '&order=' . $instance['order'];
74
- if( ! empty( $instance['orderby'] ) ) $value .= '&orderby=' . $instance['orderby'];
75
- if( ! empty( $instance['sticky'] ) ) $value .= '&sticky=' . $instance['sticky'];
76
- if( ! empty( $instance['additional'] ) ) $value .= '&additional=' . $instance['additional'];
77
  $instance[ 'posts' ] = $value;
78
 
79
  unset( $instance[ 'post_type' ] );
@@ -96,4 +97,4 @@ class SiteOrigin_Panels_Widgets_PostLoop_Helper extends SiteOrigin_Widget {
96
  function widget( $args, $instance ) {
97
  return false;
98
  }
99
- }
29
  __( 'Post Loop', 'siteorigin-panels' ),
30
  array(
31
  'description' => __( 'Displays a post loop.', 'siteorigin-panels' ),
32
+ 'has_preview' => false,
33
  ),
34
  array(),
35
  array(
67
  */
68
  function modify_instance( $instance ) {
69
  if( ! empty( $instance['post_type'] ) ) {
70
+ $value = array();
71
 
72
+ if( ! empty( $instance['post_type'] ) ) $value['post_type'] = $instance['post_type'];
73
+ if( ! empty( $instance['posts_per_page'] ) ) $value['posts_per_page'] = $instance['posts_per_page'];
74
+ if( ! empty( $instance['order'] ) ) $value['order'] = $instance['order'];
75
+ if( ! empty( $instance['orderby'] ) ) $value['orderby'] = $instance['orderby'];
76
+ if( ! empty( $instance['sticky'] ) ) $value['sticky'] = $instance['sticky'];
77
+ if( ! empty( $instance['additional'] ) ) $value['additional'] = $instance['additional'];
78
  $instance[ 'posts' ] = $value;
79
 
80
  unset( $instance[ 'post_type' ] );
97
  function widget( $args, $instance ) {
98
  return false;
99
  }
100
+ }
inc/widgets/post-loop.php CHANGED
@@ -9,6 +9,11 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget{
9
 
10
  static $rendering_loop;
11
 
 
 
 
 
 
12
  function __construct() {
13
  parent::__construct(
14
  'siteorigin-panels-postloop',
@@ -32,7 +37,7 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget{
32
  */
33
  function update( $new, $old ){
34
  if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
35
- $helper = new SiteOrigin_Panels_Widgets_PostLoop_Helper( $this->get_loop_templates() );
36
  return $helper->update( $new, $old );
37
  }
38
  else {
@@ -182,15 +187,8 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget{
182
  // If the Widgets Bundle is installed and the post selector is available, use that.
183
  // Otherwise revert back to our own form fields.
184
  if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
185
- $helper = new SiteOrigin_Panels_Widgets_PostLoop_Helper( $templates );
186
-
187
- ob_start();
188
  $helper->form( $instance );
189
- $form_html = ob_get_clean();
190
-
191
- $form_html = preg_replace_callback( '/name="widget-siteorigin-panels-postloop-helper[^\"]+\[(.*?)\]"/', array( $this, 'fix_helper_form_callback' ), $form_html );
192
-
193
- echo $form_html;
194
  }
195
  else {
196
  $instance = wp_parse_args( $instance, array(
@@ -347,7 +345,25 @@ class SiteOrigin_Panels_Widgets_PostLoop extends WP_Widget{
347
  return $templates;
348
  }
349
 
350
- function fix_helper_form_callback( $match ){
351
- return 'name="' . $this->get_field_name( $match[1] ) . '"';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  }
353
- }
9
 
10
  static $rendering_loop;
11
 
12
+ /**
13
+ * @var SiteOrigin_Panels_Widgets_PostLoop_Helper
14
+ */
15
+ private $helper;
16
+
17
  function __construct() {
18
  parent::__construct(
19
  'siteorigin-panels-postloop',
37
  */
38
  function update( $new, $old ){
39
  if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
40
+ $helper = $this->get_helper_widget( $this->get_loop_templates() );
41
  return $helper->update( $new, $old );
42
  }
43
  else {
187
  // If the Widgets Bundle is installed and the post selector is available, use that.
188
  // Otherwise revert back to our own form fields.
189
  if( class_exists( 'SiteOrigin_Widget' ) && class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
190
+ $helper = $this->get_helper_widget( $templates );
 
 
191
  $helper->form( $instance );
 
 
 
 
 
192
  }
193
  else {
194
  $instance = wp_parse_args( $instance, array(
345
  return $templates;
346
  }
347
 
348
+
349
+ /**
350
+ * Get the helper widget based on the Widgets Bundle's classes.
351
+ *
352
+ * @param $templates array Blog loop templates.
353
+ *
354
+ * @return mixed
355
+ */
356
+ private function get_helper_widget( $templates ) {
357
+ if ( empty( $this->helper ) &&
358
+ class_exists( 'SiteOrigin_Widget' ) &&
359
+ class_exists( 'SiteOrigin_Widget_Field_Posts' ) ) {
360
+ $this->helper = new SiteOrigin_Panels_Widgets_PostLoop_Helper( $templates );
361
+ // These ensure the form fields name attributes are correct.
362
+ $this->helper->id_base = $this->id_base;
363
+ $this->helper->id = $this->id;
364
+ $this->helper->number = $this->number;
365
+ }
366
+
367
+ return $this->helper;
368
  }
369
+ }
lang/siteorigin-panels.pot CHANGED
@@ -889,7 +889,7 @@ msgstr ""
889
  msgid "Collapse Order"
890
  msgstr ""
891
 
892
- #: tmp/inc/styles.php:229, tmp/inc/widgets/post-loop.php:294, tmp/widgets/widgets.php:635, tmp/widgets/widgets.php:757
893
  msgid "Default"
894
  msgstr ""
895
 
@@ -973,11 +973,11 @@ msgstr ""
973
  msgid "Displays content from the current post."
974
  msgstr ""
975
 
976
- #: tmp/inc/widgets/post-content.php:60, tmp/inc/widgets/post-loop.php:268, tmp/widgets/widgets.php:608, tmp/widgets/widgets.php:783
977
  msgid "None"
978
  msgstr ""
979
 
980
- #: tmp/inc/widgets/post-content.php:61, tmp/inc/widgets/post-loop-helper.php:37, tmp/inc/widgets/post-loop.php:215, tmp/widgets/widgets/call-to-action/call-to-action.php:15, tmp/widgets/widgets/list/list.php:15, tmp/widgets/widgets/price-box/price-box.php:15
981
  msgid "Title"
982
  msgstr ""
983
 
@@ -989,115 +989,115 @@ msgstr ""
989
  msgid "Display Content"
990
  msgstr ""
991
 
992
- #: tmp/inc/widgets/post-loop-helper.php:29, tmp/inc/widgets/post-loop.php:15
993
  msgid "Post Loop"
994
  msgstr ""
995
 
996
- #: tmp/inc/widgets/post-loop-helper.php:31, tmp/inc/widgets/post-loop.php:17
997
  msgid "Displays a post loop."
998
  msgstr ""
999
 
1000
- #: tmp/inc/widgets/post-loop-helper.php:41, tmp/inc/widgets/post-loop.php:219
1001
  msgid "Template"
1002
  msgstr ""
1003
 
1004
- #: tmp/inc/widgets/post-loop-helper.php:48, tmp/inc/widgets/post-loop.php:237
1005
  msgid "If the template supports it, cut posts and display the more link."
1006
  msgstr ""
1007
 
1008
- #: tmp/inc/widgets/post-loop.php:178
1009
  msgid "Your theme doesn't have any post loops."
1010
  msgstr ""
1011
 
1012
- #: tmp/inc/widgets/post-loop.php:235
1013
  msgid "More Link"
1014
  msgstr ""
1015
 
1016
- #: tmp/inc/widgets/post-loop.php:252, tmp/widgets/widgets.php:594
1017
  msgid "Post Type"
1018
  msgstr ""
1019
 
1020
- #: tmp/inc/widgets/post-loop.php:261, tmp/widgets/widgets.php:601
1021
  msgid "Posts Per Page"
1022
  msgstr ""
1023
 
1024
- #: tmp/inc/widgets/post-loop.php:266, tmp/widgets/widgets.php:606
1025
  msgid "Order By"
1026
  msgstr ""
1027
 
1028
- #: tmp/inc/widgets/post-loop.php:269, tmp/widgets/widgets.php:609
1029
  msgid "Post ID"
1030
  msgstr ""
1031
 
1032
- #: tmp/inc/widgets/post-loop.php:270, tmp/widgets/widgets.php:610
1033
  msgid "Author"
1034
  msgstr ""
1035
 
1036
- #: tmp/inc/widgets/post-loop.php:271, tmp/inc/widgets/post-loop.php:272, tmp/widgets/widgets.php:611, tmp/widgets/widgets.php:612, tmp/widgets/widgets/testimonial/testimonial.php:15
1037
  msgid "Name"
1038
  msgstr ""
1039
 
1040
- #: tmp/inc/widgets/post-loop.php:273, tmp/widgets/widgets.php:613
1041
  msgid "Date"
1042
  msgstr ""
1043
 
1044
- #: tmp/inc/widgets/post-loop.php:274, tmp/widgets/widgets.php:614
1045
  msgid "Modified"
1046
  msgstr ""
1047
 
1048
- #: tmp/inc/widgets/post-loop.php:275, tmp/widgets/widgets.php:615
1049
  msgid "Parent"
1050
  msgstr ""
1051
 
1052
- #: tmp/inc/widgets/post-loop.php:276, tmp/widgets/widgets.php:616
1053
  msgid "Random"
1054
  msgstr ""
1055
 
1056
- #: tmp/inc/widgets/post-loop.php:277, tmp/widgets/widgets.php:617
1057
  msgid "Comment Count"
1058
  msgstr ""
1059
 
1060
- #: tmp/inc/widgets/post-loop.php:278, tmp/widgets/widgets.php:618
1061
  msgid "Menu Order"
1062
  msgstr ""
1063
 
1064
- #: tmp/inc/widgets/post-loop.php:279
1065
  msgid "Post In Order"
1066
  msgstr ""
1067
 
1068
- #: tmp/inc/widgets/post-loop.php:284, tmp/widgets/widgets.php:624
1069
  msgid "Order"
1070
  msgstr ""
1071
 
1072
- #: tmp/inc/widgets/post-loop.php:286, tmp/widgets/widgets.php:627
1073
  msgid "Descending"
1074
  msgstr ""
1075
 
1076
- #: tmp/inc/widgets/post-loop.php:287, tmp/widgets/widgets.php:626
1077
  msgid "Ascending"
1078
  msgstr ""
1079
 
1080
- #: tmp/inc/widgets/post-loop.php:292, tmp/widgets/widgets.php:633
1081
  msgid "Sticky Posts"
1082
  msgstr ""
1083
 
1084
- #: tmp/inc/widgets/post-loop.php:295, tmp/widgets/widgets.php:636
1085
  msgid "Ignore Sticky"
1086
  msgstr ""
1087
 
1088
- #: tmp/inc/widgets/post-loop.php:296, tmp/widgets/widgets.php:637
1089
  msgid "Exclude Sticky"
1090
  msgstr ""
1091
 
1092
- #: tmp/inc/widgets/post-loop.php:297, tmp/widgets/widgets.php:638
1093
  msgid "Only Sticky"
1094
  msgstr ""
1095
 
1096
- #: tmp/inc/widgets/post-loop.php:302
1097
  msgid "Additional "
1098
  msgstr ""
1099
 
1100
- #: tmp/inc/widgets/post-loop.php:309, tmp/widgets/widgets.php:648
1101
  msgid "Additional query arguments. See 1{query_posts}."
1102
  msgstr ""
1103
 
889
  msgid "Collapse Order"
890
  msgstr ""
891
 
892
+ #: tmp/inc/styles.php:229, tmp/inc/widgets/post-loop.php:292, tmp/widgets/widgets.php:635, tmp/widgets/widgets.php:757
893
  msgid "Default"
894
  msgstr ""
895
 
973
  msgid "Displays content from the current post."
974
  msgstr ""
975
 
976
+ #: tmp/inc/widgets/post-content.php:60, tmp/inc/widgets/post-loop.php:266, tmp/widgets/widgets.php:608, tmp/widgets/widgets.php:783
977
  msgid "None"
978
  msgstr ""
979
 
980
+ #: tmp/inc/widgets/post-content.php:61, tmp/inc/widgets/post-loop-helper.php:38, tmp/inc/widgets/post-loop.php:213, tmp/widgets/widgets/call-to-action/call-to-action.php:15, tmp/widgets/widgets/list/list.php:15, tmp/widgets/widgets/price-box/price-box.php:15
981
  msgid "Title"
982
  msgstr ""
983
 
989
  msgid "Display Content"
990
  msgstr ""
991
 
992
+ #: tmp/inc/widgets/post-loop-helper.php:29, tmp/inc/widgets/post-loop.php:20
993
  msgid "Post Loop"
994
  msgstr ""
995
 
996
+ #: tmp/inc/widgets/post-loop-helper.php:31, tmp/inc/widgets/post-loop.php:22
997
  msgid "Displays a post loop."
998
  msgstr ""
999
 
1000
+ #: tmp/inc/widgets/post-loop-helper.php:42, tmp/inc/widgets/post-loop.php:217
1001
  msgid "Template"
1002
  msgstr ""
1003
 
1004
+ #: tmp/inc/widgets/post-loop-helper.php:49, tmp/inc/widgets/post-loop.php:235
1005
  msgid "If the template supports it, cut posts and display the more link."
1006
  msgstr ""
1007
 
1008
+ #: tmp/inc/widgets/post-loop.php:183
1009
  msgid "Your theme doesn't have any post loops."
1010
  msgstr ""
1011
 
1012
+ #: tmp/inc/widgets/post-loop.php:233
1013
  msgid "More Link"
1014
  msgstr ""
1015
 
1016
+ #: tmp/inc/widgets/post-loop.php:250, tmp/widgets/widgets.php:594
1017
  msgid "Post Type"
1018
  msgstr ""
1019
 
1020
+ #: tmp/inc/widgets/post-loop.php:259, tmp/widgets/widgets.php:601
1021
  msgid "Posts Per Page"
1022
  msgstr ""
1023
 
1024
+ #: tmp/inc/widgets/post-loop.php:264, tmp/widgets/widgets.php:606
1025
  msgid "Order By"
1026
  msgstr ""
1027
 
1028
+ #: tmp/inc/widgets/post-loop.php:267, tmp/widgets/widgets.php:609
1029
  msgid "Post ID"
1030
  msgstr ""
1031
 
1032
+ #: tmp/inc/widgets/post-loop.php:268, tmp/widgets/widgets.php:610
1033
  msgid "Author"
1034
  msgstr ""
1035
 
1036
+ #: tmp/inc/widgets/post-loop.php:269, tmp/inc/widgets/post-loop.php:270, tmp/widgets/widgets.php:611, tmp/widgets/widgets.php:612, tmp/widgets/widgets/testimonial/testimonial.php:15
1037
  msgid "Name"
1038
  msgstr ""
1039
 
1040
+ #: tmp/inc/widgets/post-loop.php:271, tmp/widgets/widgets.php:613
1041
  msgid "Date"
1042
  msgstr ""
1043
 
1044
+ #: tmp/inc/widgets/post-loop.php:272, tmp/widgets/widgets.php:614
1045
  msgid "Modified"
1046
  msgstr ""
1047
 
1048
+ #: tmp/inc/widgets/post-loop.php:273, tmp/widgets/widgets.php:615
1049
  msgid "Parent"
1050
  msgstr ""
1051
 
1052
+ #: tmp/inc/widgets/post-loop.php:274, tmp/widgets/widgets.php:616
1053
  msgid "Random"
1054
  msgstr ""
1055
 
1056
+ #: tmp/inc/widgets/post-loop.php:275, tmp/widgets/widgets.php:617
1057
  msgid "Comment Count"
1058
  msgstr ""
1059
 
1060
+ #: tmp/inc/widgets/post-loop.php:276, tmp/widgets/widgets.php:618
1061
  msgid "Menu Order"
1062
  msgstr ""
1063
 
1064
+ #: tmp/inc/widgets/post-loop.php:277
1065
  msgid "Post In Order"
1066
  msgstr ""
1067
 
1068
+ #: tmp/inc/widgets/post-loop.php:282, tmp/widgets/widgets.php:624
1069
  msgid "Order"
1070
  msgstr ""
1071
 
1072
+ #: tmp/inc/widgets/post-loop.php:284, tmp/widgets/widgets.php:627
1073
  msgid "Descending"
1074
  msgstr ""
1075
 
1076
+ #: tmp/inc/widgets/post-loop.php:285, tmp/widgets/widgets.php:626
1077
  msgid "Ascending"
1078
  msgstr ""
1079
 
1080
+ #: tmp/inc/widgets/post-loop.php:290, tmp/widgets/widgets.php:633
1081
  msgid "Sticky Posts"
1082
  msgstr ""
1083
 
1084
+ #: tmp/inc/widgets/post-loop.php:293, tmp/widgets/widgets.php:636
1085
  msgid "Ignore Sticky"
1086
  msgstr ""
1087
 
1088
+ #: tmp/inc/widgets/post-loop.php:294, tmp/widgets/widgets.php:637
1089
  msgid "Exclude Sticky"
1090
  msgstr ""
1091
 
1092
+ #: tmp/inc/widgets/post-loop.php:295, tmp/widgets/widgets.php:638
1093
  msgid "Only Sticky"
1094
  msgstr ""
1095
 
1096
+ #: tmp/inc/widgets/post-loop.php:300
1097
  msgid "Additional "
1098
  msgstr ""
1099
 
1100
+ #: tmp/inc/widgets/post-loop.php:307, tmp/widgets/widgets.php:648
1101
  msgid "Additional query arguments. See 1{query_posts}."
1102
  msgstr ""
1103
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
3
  Requires at least: 4.4
4
  Tested up to: 4.8
5
- Stable tag: 2.5.3
6
- Build time: 2017-06-01T11:53:46+02:00
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
  Donate link: https://siteorigin.com/downloads/contribution/
@@ -96,6 +96,10 @@ We've tried to ensure that Page Builder is compatible with most plugin widgets.
96
 
97
  == Changelog ==
98
 
 
 
 
 
99
  = 2.5.4 - 1 June 2017 =
100
  * Compatibility with WordPress 4.8 widgets.
101
  * Refactored core widgets.
2
  Tags: page builder, responsive, widget, widgets, builder, page, admin, gallery, content, cms, pages, post, css, layout, grid
3
  Requires at least: 4.4
4
  Tested up to: 4.8
5
+ Stable tag: 2.5.4
6
+ Build time: 2017-06-08T10:19:14+02:00
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
  Donate link: https://siteorigin.com/downloads/contribution/
96
 
97
  == Changelog ==
98
 
99
+ = 2.5.5 - 8 June 2017 =
100
+ * Ensure form fields name attributes are correct when using the Widgets Bundle post loop helper.
101
+ * Prevent display of unimplemented preview button for Post Loop widget.
102
+
103
  = 2.5.4 - 1 June 2017 =
104
  * Compatibility with WordPress 4.8 widgets.
105
  * Refactored core widgets.
siteorigin-panels.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Page Builder by SiteOrigin
4
  Plugin URI: https://siteorigin.com/page-builder/
5
  Description: A drag and drop, responsive page builder that simplifies building your website.
6
- Version: 2.5.4
7
  Author: SiteOrigin
8
  Author URI: https://siteorigin.com
9
  License: GPL3
@@ -11,7 +11,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
11
  Donate link: http://siteorigin.com/page-builder/#donate
12
  */
13
 
14
- define( 'SITEORIGIN_PANELS_VERSION', '2.5.4' );
15
  if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
16
  define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
17
  }
3
  Plugin Name: Page Builder by SiteOrigin
4
  Plugin URI: https://siteorigin.com/page-builder/
5
  Description: A drag and drop, responsive page builder that simplifies building your website.
6
+ Version: 2.5.5
7
  Author: SiteOrigin
8
  Author URI: https://siteorigin.com
9
  License: GPL3
11
  Donate link: http://siteorigin.com/page-builder/#donate
12
  */
13
 
14
+ define( 'SITEORIGIN_PANELS_VERSION', '2.5.5' );
15
  if ( ! defined( 'SITEORIGIN_PANELS_JS_SUFFIX' ) ) {
16
  define( 'SITEORIGIN_PANELS_JS_SUFFIX', '.min' );
17
  }