WordPress Page Builder – Beaver Builder - Version 1.3.7

Version Description

Download this release

Release Info

Developer justinbusa
Plugin Icon 128x128 WordPress Page Builder – Beaver Builder
Version 1.3.7
Comparing to
See all releases

Code changes from version 1.3.6 to 1.3.7

changelog.txt CHANGED
@@ -1,3 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <h4>1.3.6</h4>
2
  <p><strong>Enhancements</strong></p>
3
  <ul>
1
+ <h4>1.3.7</h4>
2
+ <p><strong>Enhancements</strong></p>
3
+ <ul>
4
+ <li>Added circle crop option to the photo module.</li>
5
+ <li>Added icon setting for white labeling.</li>
6
+ </ul>
7
+ <p><strong>Bug Fixes</strong></p>
8
+ <ul>
9
+ <li>Fixed a bug with the posts module that kept shortcodes from rendering.</li>
10
+ <li>Fixed a bug that made it impossible to append the same template twice.</li>
11
+ <li>Fixed a bug that broke photo cropping.</li>
12
+ </ul>
13
+
14
  <h4>1.3.6</h4>
15
  <p><strong>Enhancements</strong></p>
16
  <ul>
classes/FLBuilder.php CHANGED
@@ -544,7 +544,7 @@ final class FLBuilder {
544
  echo '<div class="fl-builder-content">';
545
  self::render_rows();
546
  echo '</div>';
547
- $content = ob_get_clean();
548
 
549
  // Reapply the builder's render_content filter.
550
  add_filter('the_content', 'FLBuilder::render_content');
544
  echo '<div class="fl-builder-content">';
545
  self::render_rows();
546
  echo '</div>';
547
+ $content = do_shortcode(ob_get_clean());
548
 
549
  // Reapply the builder's render_content filter.
550
  add_filter('the_content', 'FLBuilder::render_content');
classes/FLBuilderAdminSettings.php CHANGED
@@ -152,9 +152,11 @@ final class FLBuilderAdminSettings {
152
  {
153
  if(isset($_POST['fl-branding-nonce']) && wp_verify_nonce($_POST['fl-branding-nonce'], 'branding')) {
154
 
155
- $branding = wp_kses_post($_POST['fl-branding']);
 
156
 
157
  update_option('_fl_builder_branding', $branding);
 
158
  }
159
  }
160
 
152
  {
153
  if(isset($_POST['fl-branding-nonce']) && wp_verify_nonce($_POST['fl-branding-nonce'], 'branding')) {
154
 
155
+ $branding = wp_kses_post($_POST['fl-branding']);
156
+ $branding_icon = sanitize_text_field($_POST['fl-branding-icon']);
157
 
158
  update_option('_fl_builder_branding', $branding);
159
+ update_option('_fl_builder_branding_icon', $branding_icon);
160
  }
161
  }
162
 
classes/FLBuilderModel.php CHANGED
@@ -675,9 +675,16 @@ final class FLBuilderModel {
675
  $post_data = self::get_post_data();
676
 
677
  if(isset($post_data['node_preview']) && isset($post_data['node_id']) && $post_data['node_id'] == $node->node) {
678
- $settings = $post_data['node_preview'];
679
- $settings = (object)array_merge((array)$node->settings, (array)$settings);
680
- $settings = self::process_node_settings($node, $settings);
 
 
 
 
 
 
 
681
  }
682
  else {
683
  $defaults = self::get_node_defaults($node);
@@ -1918,6 +1925,11 @@ final class FLBuilderModel {
1918
  if(empty($data)) {
1919
  $data = array();
1920
  }
 
 
 
 
 
1921
 
1922
  // Return the data.
1923
  return $data;
@@ -1985,10 +1997,9 @@ final class FLBuilderModel {
1985
  */
1986
  static public function save_layout()
1987
  {
1988
- $post_data = self::get_post_data();
1989
  $editor_content = FLBuilder::render_editor_content();
1990
  $post_id = self::get_post_id();
1991
- $data = self::get_layout_data();
1992
 
1993
  // Delete the old published layout.
1994
  self::delete_layout_data('published', $post_id);
@@ -2006,7 +2017,7 @@ final class FLBuilderModel {
2006
  self::enable();
2007
 
2008
  // Get the post status.
2009
- $post_status = get_post_status($post_data['post_id']);
2010
  $post_status = strstr($post_status, 'draft') ? 'publish' : $post_status;
2011
 
2012
  // Update the post with stripped down content.
@@ -2258,22 +2269,25 @@ final class FLBuilderModel {
2258
  // Only move forward if we have template nodes.
2259
  if(isset($template->nodes)) {
2260
 
 
 
 
2261
  // Get the existing layout data.
2262
  $layout_data = self::get_layout_data();
2263
 
2264
  // Reposition rows?
2265
  if($append) {
2266
 
2267
- foreach($template->nodes as $node_id => $node) {
2268
 
2269
  if($node->type == 'row') {
2270
- $template->nodes[$node_id]->position += $row_position;
2271
  }
2272
  }
2273
  }
2274
 
2275
  // Merge the data.
2276
- $data = array_merge($layout_data, $template->nodes);
2277
 
2278
  // Update the layout data.
2279
  self::update_layout_data($data);
@@ -2347,6 +2361,31 @@ final class FLBuilderModel {
2347
  }
2348
  }
2349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2350
  /**
2351
  * We don't delete _fl_builder_enabled, _fl_builder_data and _fl_builder_draft
2352
  * so layouts can be recovered should the plugin be installed again.
675
  $post_data = self::get_post_data();
676
 
677
  if(isset($post_data['node_preview']) && isset($post_data['node_id']) && $post_data['node_id'] == $node->node) {
678
+
679
+ if(!isset($post_data['node_preview_processed_settings'])) {
680
+ $settings = $post_data['node_preview'];
681
+ $settings = (object)array_merge((array)$node->settings, (array)$settings);
682
+ $settings = self::process_node_settings($node, $settings);
683
+ self::update_post_data('node_preview_processed_settings', $settings);
684
+ }
685
+ else {
686
+ $settings = $post_data['node_preview_processed_settings'];
687
+ }
688
  }
689
  else {
690
  $defaults = self::get_node_defaults($node);
1925
  if(empty($data)) {
1926
  $data = array();
1927
  }
1928
+
1929
+ // Clone the layout data to ensure the cache remains intact.
1930
+ foreach($data as $node_id => $node) {
1931
+ $data[$node_id] = clone $node;
1932
+ }
1933
 
1934
  // Return the data.
1935
  return $data;
1997
  */
1998
  static public function save_layout()
1999
  {
 
2000
  $editor_content = FLBuilder::render_editor_content();
2001
  $post_id = self::get_post_id();
2002
+ $data = self::get_layout_data('draft', $post_id);
2003
 
2004
  // Delete the old published layout.
2005
  self::delete_layout_data('published', $post_id);
2017
  self::enable();
2018
 
2019
  // Get the post status.
2020
+ $post_status = get_post_status($post_id);
2021
  $post_status = strstr($post_status, 'draft') ? 'publish' : $post_status;
2022
 
2023
  // Update the post with stripped down content.
2269
  // Only move forward if we have template nodes.
2270
  if(isset($template->nodes)) {
2271
 
2272
+ // Get new ids for the template nodes.
2273
+ $template_data = self::generate_new_node_ids($template->nodes);
2274
+
2275
  // Get the existing layout data.
2276
  $layout_data = self::get_layout_data();
2277
 
2278
  // Reposition rows?
2279
  if($append) {
2280
 
2281
+ foreach($template_data as $node_id => $node) {
2282
 
2283
  if($node->type == 'row') {
2284
+ $template_data[$node_id]->position += $row_position;
2285
  }
2286
  }
2287
  }
2288
 
2289
  // Merge the data.
2290
+ $data = array_merge($layout_data, $template_data);
2291
 
2292
  // Update the layout data.
2293
  self::update_layout_data($data);
2361
  }
2362
  }
2363
 
2364
+ /**
2365
+ * @method get_branding_icon
2366
+ */
2367
+ static public function get_branding_icon()
2368
+ {
2369
+ $key = '_fl_builder_branding_icon';
2370
+ $default = FL_BUILDER_URL . 'img/beaver.png';
2371
+
2372
+ // Get the value.
2373
+ if(is_network_admin() || class_exists('FLBuilderMultisiteSettings')) {
2374
+ $value = get_site_option($key);
2375
+ }
2376
+ else {
2377
+ $value = get_option($key);
2378
+ }
2379
+
2380
+ // Return the value.
2381
+ if($value === false) {
2382
+ return $default;
2383
+ }
2384
+ else {
2385
+ return $value;
2386
+ }
2387
+ }
2388
+
2389
  /**
2390
  * We don't delete _fl_builder_enabled, _fl_builder_data and _fl_builder_draft
2391
  * so layouts can be recovered should the plugin be installed again.
css/fl-builder-layout.css CHANGED
@@ -248,6 +248,11 @@
248
  max-width: 100%;
249
  width: auto !important;
250
  }
 
 
 
 
 
251
  .fl-photo-caption {
252
  font-size: 13px;
253
  line-height: 18px;
248
  max-width: 100%;
249
  width: auto !important;
250
  }
251
+ .fl-photo-crop-circle img {
252
+ -webkit-border-radius: 100%;
253
+ -moz-border-radius: 100%;
254
+ border-radius: 100%;
255
+ }
256
  .fl-photo-caption {
257
  font-size: 13px;
258
  line-height: 18px;
css/fl-builder.css CHANGED
@@ -121,14 +121,14 @@ html.fl-builder-edit {
121
  padding: 7px 10px;
122
  }
123
  .fl-builder-bar-title img {
124
- height: 30px;
125
- margin-right: 1px;
126
- vertical-align: middle;
127
  }
128
  .fl-builder-bar-title span {
129
  vertical-align: middle;
130
  }
131
- .fl-builder-bar-title.fl-builder-branding {
132
  padding: 12px;
133
  }
134
  .fl-builder-bar-actions {
121
  padding: 7px 10px;
122
  }
123
  .fl-builder-bar-title img {
124
+ height: 30px !important;
125
+ margin: 0 1px 0 0 !important;
126
+ vertical-align: middle !important;
127
  }
128
  .fl-builder-bar-title span {
129
  vertical-align: middle;
130
  }
131
+ .fl-builder-bar-title.fl-builder-bar-title-no-icon {
132
  padding: 12px;
133
  }
134
  .fl-builder-bar-actions {
fl-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
  * Plugin URI: http://www.wpbeaverbuilder.com
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
- * Version: 1.3.6
7
  * Author: The Beaver Builder Team
8
  * Author URI: http://www.wpbeaverbuilder.com
9
  * Copyright: (c) 2014 Beaver Builder
@@ -11,7 +11,7 @@
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * Text Domain: fl-builder
13
  */
14
- define('FL_BUILDER_VERSION', '1.3.6');
15
  define('FL_BUILDER_DIR', plugin_dir_path(__FILE__));
16
  define('FL_BUILDER_URL', plugins_url('/', __FILE__));
17
  define('FL_BUILDER_LITE', true);
3
  * Plugin Name: Beaver Builder Plugin (Lite Version)
4
  * Plugin URI: http://www.wpbeaverbuilder.com
5
  * Description: A drag and drop frontend WordPress page builder plugin that works with almost any theme!
6
+ * Version: 1.3.7
7
  * Author: The Beaver Builder Team
8
  * Author URI: http://www.wpbeaverbuilder.com
9
  * Copyright: (c) 2014 Beaver Builder
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  * Text Domain: fl-builder
13
  */
14
+ define('FL_BUILDER_VERSION', '1.3.7');
15
  define('FL_BUILDER_DIR', plugin_dir_path(__FILE__));
16
  define('FL_BUILDER_URL', plugins_url('/', __FILE__));
17
  define('FL_BUILDER_LITE', true);
includes/admin-settings.php CHANGED
@@ -1,8 +1,8 @@
1
  <div class="wrap<?php if(!class_exists('FLBuilderMultisiteSettings')) echo ' fl-settings-single-install'; ?>">
2
 
3
  <h2 class="fl-settings-heading">
4
- <?php if(FLBuilderModel::get_branding() == __('Page Builder', 'fl-builder')) : ?>
5
- <img src="<?php echo FL_BUILDER_URL; ?>/img/beaver.png" />
6
  <?php endif; ?>
7
  <span><?php echo FLBuilderModel::get_branding() . ' ' . __('Settings', 'fl-builder'); ?></span>
8
  </h2>
1
  <div class="wrap<?php if(!class_exists('FLBuilderMultisiteSettings')) echo ' fl-settings-single-install'; ?>">
2
 
3
  <h2 class="fl-settings-heading">
4
+ <?php if(FLBuilderModel::get_branding_icon() != '') : ?>
5
+ <img src="<?php echo FLBuilderModel::get_branding_icon(); ?>" />
6
  <?php endif; ?>
7
  <span><?php echo FLBuilderModel::get_branding() . ' ' . __('Settings', 'fl-builder'); ?></span>
8
  </h2>
includes/ui.php CHANGED
@@ -5,14 +5,14 @@
5
  <img src="<?php echo FL_BUILDER_URL; ?>/img/beaver.png" />
6
  <span><?php _e('Page Builder Demo', 'fl-builder'); ?></span>
7
  </span>
8
- <?php elseif(FLBuilderModel::get_branding() != __('Page Builder', 'fl-builder')) : ?>
9
- <span class="fl-builder-bar-title fl-builder-branding">
10
  <?php echo FLBuilderModel::get_branding(); ?>
11
  </span>
12
  <?php else : ?>
13
  <span class="fl-builder-bar-title">
14
- <img src="<?php echo FL_BUILDER_URL; ?>/img/beaver.png" />
15
- <span><?php _e('Page Builder', 'fl-builder'); ?></span>
16
  </span>
17
  <?php endif; ?>
18
  <div class="fl-builder-bar-actions">
5
  <img src="<?php echo FL_BUILDER_URL; ?>/img/beaver.png" />
6
  <span><?php _e('Page Builder Demo', 'fl-builder'); ?></span>
7
  </span>
8
+ <?php elseif(FLBuilderModel::get_branding_icon() == '') : ?>
9
+ <span class="fl-builder-bar-title fl-builder-bar-title-no-icon">
10
  <?php echo FLBuilderModel::get_branding(); ?>
11
  </span>
12
  <?php else : ?>
13
  <span class="fl-builder-bar-title">
14
+ <img src="<?php echo FLBuilderModel::get_branding_icon(); ?>" />
15
+ <span><?php echo FLBuilderModel::get_branding(); ?></span>
16
  </span>
17
  <?php endif; ?>
18
  <div class="fl-builder-bar-actions">
includes/updater-config.php CHANGED
@@ -3,7 +3,7 @@
3
  if(class_exists('FLUpdater')) {
4
  FLUpdater::add_product(array(
5
  'name' => 'Beaver Builder Plugin (Lite Version)',
6
- 'version' => '1.3.6',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin'
9
  ));
3
  if(class_exists('FLUpdater')) {
4
  FLUpdater::add_product(array(
5
  'name' => 'Beaver Builder Plugin (Lite Version)',
6
+ 'version' => '1.3.7',
7
  'slug' => 'bb-plugin',
8
  'type' => 'plugin'
9
  ));
modules/photo/includes/frontend.php CHANGED
@@ -6,7 +6,7 @@ $link = $module->get_link();
6
  $alt = $module->get_alt();
7
 
8
  ?>
9
- <div class="fl-photo fl-photo-align-<?php echo $settings->align; ?>" itemscope itemtype="http://schema.org/ImageObject">
10
  <div class="fl-photo-content">
11
  <?php if(!empty($link)) : ?>
12
  <a href="<?php echo $link; ?>" target="<?php echo $settings->link_target; ?>" itemprop="url">
6
  $alt = $module->get_alt();
7
 
8
  ?>
9
+ <div class="fl-photo fl-photo-crop-<?php echo $settings->crop; ?> fl-photo-align-<?php echo $settings->align; ?>" itemscope itemtype="http://schema.org/ImageObject">
10
  <div class="fl-photo-content">
11
  <?php if(!empty($link)) : ?>
12
  <a href="<?php echo $link; ?>" target="<?php echo $settings->link_target; ?>" itemprop="url">
modules/photo/photo.php CHANGED
@@ -103,6 +103,10 @@ class FLPhotoModule extends FLBuilderModule {
103
  $ratio_1 = 1;
104
  $ratio_2 = 1;
105
  }
 
 
 
 
106
 
107
  // Get the new width or height.
108
  if($size['width'] / $size['height'] < $ratio_1) {
@@ -387,7 +391,8 @@ FLBuilder::register_module('FLPhotoModule', array(
387
  'landscape' => __('Landscape', 'fl-builder'),
388
  'panorama' => __('Panorama', 'fl-builder'),
389
  'portrait' => __('Portrait', 'fl-builder'),
390
- 'square' => __('Square', 'fl-builder')
 
391
  )
392
  ),
393
  'align' => array(
103
  $ratio_1 = 1;
104
  $ratio_2 = 1;
105
  }
106
+ elseif($this->settings->crop == 'circle') {
107
+ $ratio_1 = 1;
108
+ $ratio_2 = 1;
109
+ }
110
 
111
  // Get the new width or height.
112
  if($size['width'] / $size['height'] < $ratio_1) {
391
  'landscape' => __('Landscape', 'fl-builder'),
392
  'panorama' => __('Panorama', 'fl-builder'),
393
  'portrait' => __('Portrait', 'fl-builder'),
394
+ 'square' => __('Square', 'fl-builder'),
395
+ 'circle' => __('Circle', 'fl-builder')
396
  )
397
  ),
398
  'align' => array(
readme.txt CHANGED
@@ -69,4 +69,5 @@ Visit our [change logs page](http://www.wpbeaverbuilder.com/change-logs/) for up
69
 
70
  == Upgrade Notice ==
71
 
72
- Visit our [change logs page](http://www.wpbeaverbuilder.com/change-logs) for up-to-date information on what has been going on with the development of Beaver Builder.
 
69
 
70
  == Upgrade Notice ==
71
 
72
+ Visit our [change logs page](http://www.wpbeaverbuilder.com/change-logs) for up-to-date information on what has been going on with the development of Beaver Builder.
73
+