Nimble Page Builder - Version 3.1.30

Version Description

Visit the Github release page.

Download this release

Release Info

Developer nikeo
Plugin Icon 128x128 Nimble Page Builder
Version 3.1.30
Comparing to
See all releases

Code changes from version 3.1.29 to 3.1.30

inc/admin/nb-options.php CHANGED
@@ -351,6 +351,18 @@ function print_options_page() {
351
  </fieldset>
352
  </td>
353
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
354
  <tr>
355
  <th scope="row"><?php _e('Debug Mode', 'nimble-builder'); ?></th>
356
  <td>
@@ -437,6 +449,8 @@ function nb_save_base_options() {
437
 
438
  // Shortcode parsing when customizing
439
  nb_maybe_update_checkbox_option( NIMBLE_OPT_NAME_FOR_SHORTCODE_PARSING, 'off' );
 
 
440
  // Debug mode
441
  nb_maybe_update_checkbox_option( NIMBLE_OPT_NAME_FOR_DEBUG_MODE, 'off' );
442
  }
351
  </fieldset>
352
  </td>
353
  </tr>
354
+ <tr>
355
+ <th scope="row"><?php _e('Widgets Module', 'nimble-builder'); ?></th>
356
+ <td>
357
+ <fieldset><legend class="screen-reader-text"><span><?php _e('Widgets module', 'nimble-builder'); ?></span></legend>
358
+ <?php
359
+ $widget_disabled_opt_val = get_option( NIMBLE_OPT_NAME_FOR_DISABLING_WIDGET_MODULE );
360
+ ?>
361
+ <label for="nb_widgets_disabled_in_czr"><input name="nb_widgets_disabled_in_czr" type="checkbox" id="nb_widgets_disabled_in_czr" value="on" <?php checked( $widget_disabled_opt_val, 'on' ); ?>>
362
+ <?php _e('Disable the Widgets Module', 'nimble-builder'); ?></label>
363
+ </fieldset>
364
+ </td>
365
+ </tr>
366
  <tr>
367
  <th scope="row"><?php _e('Debug Mode', 'nimble-builder'); ?></th>
368
  <td>
449
 
450
  // Shortcode parsing when customizing
451
  nb_maybe_update_checkbox_option( NIMBLE_OPT_NAME_FOR_SHORTCODE_PARSING, 'off' );
452
+ // Widgets disabled when customizing
453
+ nb_maybe_update_checkbox_option( NIMBLE_OPT_NAME_FOR_DISABLING_WIDGET_MODULE, 'off' );
454
  // Debug mode
455
  nb_maybe_update_checkbox_option( NIMBLE_OPT_NAME_FOR_DEBUG_MODE, 'off' );
456
  }
inc/sektions/ccat-constants-and-helper-functions.php CHANGED
@@ -39,6 +39,7 @@ if ( !defined( 'NIMBLE_OPT_NAME_FOR_SECTION_JSON' ) ) { define( 'NIMBLE_OPT_NAME
39
 
40
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_BACKWARD_FIXES' ) ) { define( 'NIMBLE_OPT_NAME_FOR_BACKWARD_FIXES' , 'nb_backward_fixes' ); }
41
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_SHORTCODE_PARSING' ) ) { define( 'NIMBLE_OPT_NAME_FOR_SHORTCODE_PARSING' , 'nb_shortcodes_parsed_in_czr' ); }
 
42
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_DEBUG_MODE' ) ) { define( 'NIMBLE_OPT_NAME_FOR_DEBUG_MODE' , 'nb_debug_mode_active' ); }
43
 
44
 
@@ -1046,8 +1047,8 @@ function sek_get_module_collection() {
1046
  'content-type' => 'module',
1047
  'content-id' => 'czr_widget_area_module',
1048
  'title' => __( 'WordPress widget area', 'nimble-builder' ),
1049
- 'font_icon' => '<i class="fab fa-wordpress-simple"></i>'
1050
- //'active' => sek_are_beta_features_enabled()
1051
  ),
1052
  array(
1053
  'content-type' => 'module',
@@ -3102,7 +3103,11 @@ function sek_is_nimble_widget_id( $id ) {
3102
  return NIMBLE_WIDGET_PREFIX === substr( $id, 0, strlen( NIMBLE_WIDGET_PREFIX ) );
3103
  }
3104
 
3105
-
 
 
 
 
3106
 
3107
 
3108
 
39
 
40
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_BACKWARD_FIXES' ) ) { define( 'NIMBLE_OPT_NAME_FOR_BACKWARD_FIXES' , 'nb_backward_fixes' ); }
41
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_SHORTCODE_PARSING' ) ) { define( 'NIMBLE_OPT_NAME_FOR_SHORTCODE_PARSING' , 'nb_shortcodes_parsed_in_czr' ); }
42
+ if ( !defined( 'NIMBLE_OPT_NAME_FOR_DISABLING_WIDGET_MODULE' ) ) { define( 'NIMBLE_OPT_NAME_FOR_DISABLING_WIDGET_MODULE' , 'nb_widgets_disabled_in_czr' ); }
43
  if ( !defined( 'NIMBLE_OPT_NAME_FOR_DEBUG_MODE' ) ) { define( 'NIMBLE_OPT_NAME_FOR_DEBUG_MODE' , 'nb_debug_mode_active' ); }
44
 
45
 
1047
  'content-type' => 'module',
1048
  'content-id' => 'czr_widget_area_module',
1049
  'title' => __( 'WordPress widget area', 'nimble-builder' ),
1050
+ 'font_icon' => '<i class="fab fa-wordpress-simple"></i>',
1051
+ 'active' => !sek_is_widget_module_disabled()
1052
  ),
1053
  array(
1054
  'content-type' => 'module',
3103
  return NIMBLE_WIDGET_PREFIX === substr( $id, 0, strlen( NIMBLE_WIDGET_PREFIX ) );
3104
  }
3105
 
3106
+ // @return bool
3107
+ // introduced for #883
3108
+ function sek_is_widget_module_disabled() {
3109
+ return sek_booleanize_checkbox_val( get_option( NIMBLE_OPT_NAME_FOR_DISABLING_WIDGET_MODULE ) );
3110
+ }
3111
 
3112
 
3113
 
inc/sektions/ccat-sektions-base.php CHANGED
@@ -2430,6 +2430,11 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2430
  // @fired @hook 'widgets_init'
2431
  // Creates 10 widget zones
2432
  public function sek_nimble_widgets_init() {
 
 
 
 
 
2433
  // Header/footer, widgets module, menu module have been beta tested during 5 months and released in June 2019, in version 1.8.0
2434
  $defaults = array(
2435
  'name' => '',
@@ -2441,7 +2446,7 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2441
  'before_title' => '<h2 class="widget-title">',
2442
  'after_title' => '</h2>',
2443
  );
2444
- for ( $i=1; $i < 11; $i++ ) {
2445
  $args['id'] = NIMBLE_WIDGET_PREFIX . $i;//'nimble-widget-area-'
2446
  $args['name'] = sprintf( __('Nimble widget area #%1$s', 'nimble-builder' ), $i );
2447
  $args['description'] = $args['name'];
@@ -2452,7 +2457,7 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2452
 
2453
  // Invoked @'after_setup_theme'
2454
  static function sek_get_front_module_collection() {
2455
- return apply_filters( 'sek_get_front_module_collection', [
2456
  // FRONT MODULES
2457
  'czr_simple_html_module',
2458
 
@@ -2529,8 +2534,6 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2529
  ),
2530
  //'czr_menu_design_child',
2531
 
2532
- 'czr_widget_area_module',
2533
-
2534
  'czr_social_icons_module' => array(
2535
  'czr_social_icons_module',
2536
  'czr_social_icons_settings_child',
@@ -2556,7 +2559,13 @@ if ( !class_exists( 'SEK_Front_Construct' ) ) :
2556
  ),
2557
 
2558
  'czr_shortcode_module',
2559
- ]);
 
 
 
 
 
 
2560
  }
2561
 
2562
  }//class
2430
  // @fired @hook 'widgets_init'
2431
  // Creates 10 widget zones
2432
  public function sek_nimble_widgets_init() {
2433
+ if ( sek_is_widget_module_disabled() )
2434
+ return;
2435
+
2436
+ $number_of_widgets = apply_filters( 'nimble_number_of_wp_widgets', 10 );
2437
+
2438
  // Header/footer, widgets module, menu module have been beta tested during 5 months and released in June 2019, in version 1.8.0
2439
  $defaults = array(
2440
  'name' => '',
2446
  'before_title' => '<h2 class="widget-title">',
2447
  'after_title' => '</h2>',
2448
  );
2449
+ for ( $i=1; $i < ( intval( $number_of_widgets) + 1 ); $i++ ) {
2450
  $args['id'] = NIMBLE_WIDGET_PREFIX . $i;//'nimble-widget-area-'
2451
  $args['name'] = sprintf( __('Nimble widget area #%1$s', 'nimble-builder' ), $i );
2452
  $args['description'] = $args['name'];
2457
 
2458
  // Invoked @'after_setup_theme'
2459
  static function sek_get_front_module_collection() {
2460
+ $front_module_collection = [
2461
  // FRONT MODULES
2462
  'czr_simple_html_module',
2463
 
2534
  ),
2535
  //'czr_menu_design_child',
2536
 
 
 
2537
  'czr_social_icons_module' => array(
2538
  'czr_social_icons_module',
2539
  'czr_social_icons_settings_child',
2559
  ),
2560
 
2561
  'czr_shortcode_module',
2562
+ ];
2563
+
2564
+ if ( !sek_is_widget_module_disabled() ) {
2565
+ $front_module_collection[] = 'czr_widget_area_module';
2566
+ }
2567
+
2568
+ return apply_filters( 'sek_get_front_module_collection', $front_module_collection );
2569
  }
2570
 
2571
  }//class
nimble-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Nimble Page Builder
4
  * Plugin URI: https://nimblebuilder.com
5
  * Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
6
- * Version: 3.1.29
7
  * Text Domain: nimble-builder
8
  * Author: Press Customizr
9
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
@@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) {
16
  /* ------------------------------------------------------------------------- *
17
  * CONSTANTS
18
  /* ------------------------------------------------------------------------- */
19
- $current_version = "3.1.29";
20
 
21
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
22
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
3
  * Plugin Name: Nimble Page Builder
4
  * Plugin URI: https://nimblebuilder.com
5
  * Description: Simple and smart companion that allows you to insert sections into any existing page, create landing pages or entire websites including header and footer.
6
+ * Version: 3.1.30
7
  * Text Domain: nimble-builder
8
  * Author: Press Customizr
9
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
16
  /* ------------------------------------------------------------------------- *
17
  * CONSTANTS
18
  /* ------------------------------------------------------------------------- */
19
+ $current_version = "3.1.30";
20
 
21
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
22
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: page builder, visual editor, customizer, drag and drop, header, footer, la
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.8
9
- Stable tag: 3.1.29
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.8
9
+ Stable tag: 3.1.30
10
  License: GPLv3
11
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
12
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8FMNQPU36U27J&source=url
tmpl/modules/widget_area_module_tmpl.php CHANGED
@@ -31,13 +31,14 @@ if ( !function_exists( 'Nimble\sek_maybe_print_widget_placeholder') ) {
31
  }
32
  }
33
 
34
-
35
- if ( array_key_exists( 'widget-area-id', $value ) && is_string( $value['widget-area-id'] ) ) {
36
- if ( is_active_sidebar( $value['widget-area-id'] ) ) {
37
- dynamic_sidebar( $value['widget-area-id'] );
38
- } else {
39
- if ( skp_is_customizing() ) {
40
- sek_maybe_print_widget_placeholder( $value['widget-area-id'] );
 
41
  }
42
  }
43
  }
31
  }
32
  }
33
 
34
+ if ( ! sek_is_widget_module_disabled() ) {
35
+ if ( array_key_exists( 'widget-area-id', $value ) && is_string( $value['widget-area-id'] ) ) {
36
+ if ( is_active_sidebar( $value['widget-area-id'] ) ) {
37
+ dynamic_sidebar( $value['widget-area-id'] );
38
+ } else {
39
+ if ( skp_is_customizing() ) {
40
+ sek_maybe_print_widget_placeholder( $value['widget-area-id'] );
41
+ }
42
  }
43
  }
44
  }