Nimble Page Builder - Version 1.7.7

Version Description

Fixed capability checks missing for new edit button in admin. Now checking if user can 'edit post' and 'customize'.

=

Download this release

Release Info

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

Code changes from version 1.7.6 to 1.7.7

Files changed (3) hide show
  1. inc/admin/nimble-admin.php +19 -1
  2. nimble-builder.php +2 -2
  3. readme.txt +7 -3
inc/admin/nimble-admin.php CHANGED
@@ -569,16 +569,26 @@ function sek_nimble_dashboard_callback_fn() {
569
  }
570
  add_action( 'edit_form_after_title', '\Nimble\sek_print_edit_with_nimble_btn_for_classic_editor' );
571
  function sek_print_edit_with_nimble_btn_for_classic_editor( $post ) {
 
 
 
572
  if ( did_action( 'enqueue_block_editor_assets' ) ) {
573
  return;
574
  }
575
- if ( ! sek_current_user_can_edit( $post->ID ) ) {
576
  return;
577
  }
578
  sek_print_nb_btn_edit_with_nimble( 'classic' );
579
  }
580
  add_action( 'enqueue_block_editor_assets', '\Nimble\sek_enqueue_js_asset_for_gutenberg_edit_button');
581
  function sek_enqueue_js_asset_for_gutenberg_edit_button() {
 
 
 
 
 
 
 
582
  wp_enqueue_script(
583
  'nb-gutenberg',
584
  sprintf(
@@ -593,6 +603,14 @@ function sek_enqueue_js_asset_for_gutenberg_edit_button() {
593
  }
594
  add_action( 'admin_footer', '\Nimble\sek_print_js_for_nimble_edit_btn' );
595
  function sek_print_js_for_nimble_edit_btn() {
 
 
 
 
 
 
 
 
596
  ?>
597
  <?php if ( did_action( 'enqueue_block_editor_assets' ) ) : ?>
598
  <?php // Only printed when Gutenberg editor is enabled ?>
569
  }
570
  add_action( 'edit_form_after_title', '\Nimble\sek_print_edit_with_nimble_btn_for_classic_editor' );
571
  function sek_print_edit_with_nimble_btn_for_classic_editor( $post ) {
572
+ $current_screen = get_current_screen();
573
+ if ( 'post' !== $current_screen->base )
574
+ return;
575
  if ( did_action( 'enqueue_block_editor_assets' ) ) {
576
  return;
577
  }
578
+ if ( ! sek_current_user_can_edit( $post->ID ) || ! current_user_can( 'customize' ) ) {
579
  return;
580
  }
581
  sek_print_nb_btn_edit_with_nimble( 'classic' );
582
  }
583
  add_action( 'enqueue_block_editor_assets', '\Nimble\sek_enqueue_js_asset_for_gutenberg_edit_button');
584
  function sek_enqueue_js_asset_for_gutenberg_edit_button() {
585
+ $current_screen = get_current_screen();
586
+ if ( 'post' !== $current_screen->base )
587
+ return;
588
+ $post = get_post();
589
+ if ( ! sek_current_user_can_edit( $post->ID ) || ! current_user_can( 'customize' ) ) {
590
+ return;
591
+ }
592
  wp_enqueue_script(
593
  'nb-gutenberg',
594
  sprintf(
603
  }
604
  add_action( 'admin_footer', '\Nimble\sek_print_js_for_nimble_edit_btn' );
605
  function sek_print_js_for_nimble_edit_btn() {
606
+ $current_screen = get_current_screen();
607
+ if ( 'post' !== $current_screen->base )
608
+ return;
609
+
610
+ $post = get_post();
611
+ if ( ! sek_current_user_can_edit( $post->ID ) || ! current_user_can( 'customize' ) ) {
612
+ return;
613
+ }
614
  ?>
615
  <?php if ( did_action( 'enqueue_block_editor_assets' ) ) : ?>
616
  <?php // Only printed when Gutenberg editor is enabled ?>
nimble-builder.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Nimble Page Builder
4
  * Description: Powerful drag and drop page builder using the native WordPress customizer.
5
- * Version: 1.7.6
6
  * Text Domain: nimble-builder
7
  * Author: Press Customizr
8
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
@@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  /* ------------------------------------------------------------------------- *
14
  * CONSTANTS
15
  /* ------------------------------------------------------------------------- */
16
- $current_version = "1.7.6";
17
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
18
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
19
  if ( !defined( 'NIMBLE_BASE_URL' ) ) { define( 'NIMBLE_BASE_URL' , plugins_url( NIMBLE_DIR_NAME ) ); }
2
  /**
3
  * Plugin Name: Nimble Page Builder
4
  * Description: Powerful drag and drop page builder using the native WordPress customizer.
5
+ * Version: 1.7.7
6
  * Text Domain: nimble-builder
7
  * Author: Press Customizr
8
  * Author URI: https://nimblebuilder.com/?utm_source=wp-plugins&utm_medium=wp-dashboard&utm_campaign=author-uri
13
  /* ------------------------------------------------------------------------- *
14
  * CONSTANTS
15
  /* ------------------------------------------------------------------------- */
16
+ $current_version = "1.7.7";
17
  if ( !defined( "NIMBLE_VERSION" ) ) { define( "NIMBLE_VERSION", $current_version ); }
18
  if ( !defined( 'NIMBLE_DIR_NAME' ) ) { define( 'NIMBLE_DIR_NAME' , basename( dirname( __FILE__ ) ) ); }
19
  if ( !defined( 'NIMBLE_BASE_URL' ) ) { define( 'NIMBLE_BASE_URL' , plugins_url( NIMBLE_DIR_NAME ) ); }
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.2.1
9
- Stable tag: 1.7.6
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
@@ -109,10 +109,14 @@ Nimble builder works with any WordPress theme. If you experience any problem wit
109
  7. **Theme** : try to switch to another WordPress theme, like the default WordPress theme. If you use a child theme, activate the parent theme instead.
110
 
111
  == Upgrade Notice ==
112
- = 1.7.6 =
113
- Implemented a new button "Add sections with Nimble Builder" when editing posts and pages.
114
 
115
  == Changelog ==
 
 
 
 
116
  = 1.7.6 : May 27th 2019 =
117
  * added : Implemented a new button "Add sections with Nimble Builder" when editing posts and pages.
118
 
6
  Requires at least: 4.7
7
  Requires PHP: 5.4
8
  Tested up to: 5.2.1
9
+ Stable tag: 1.7.7
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
109
  7. **Theme** : try to switch to another WordPress theme, like the default WordPress theme. If you use a child theme, activate the parent theme instead.
110
 
111
  == Upgrade Notice ==
112
+ = 1.7.7 =
113
+ Fixed capability checks missing for new edit button in admin. Now checking if user can 'edit post' and 'customize'.
114
 
115
  == Changelog ==
116
+ = 1.7.7 : May 28th 2019 =
117
+ * fixed : capability checks missing for new edit button. Now checking if user can 'edit post' and 'customize'
118
+ * improved : only print and enqueue js assets of the edit button when editing a post, a CPT or a page
119
+
120
  = 1.7.6 : May 27th 2019 =
121
  * added : Implemented a new button "Add sections with Nimble Builder" when editing posts and pages.
122