Custom Sidebars – Dynamic Widget Area Manager - Version 3.0.9

Version Description

  • Added ability to turn off "Custom Sidebars" for certain roles.
  • Fixed a problem with a category, category archive, and post in category replacement.
  • Fixed a problem with removed "Category Archive" from "For Archives" options.
  • Fixed build in taxonomies problem on "Sidebar Location" edit window.
Download this release

Release Info

Developer jdailey
Plugin Icon 128x128 Custom Sidebars – Dynamic Widget Area Manager
Version 3.0.9
Comparing to
See all releases

Code changes from version 3.0.8.1 to 3.0.9

css/cs-cloning.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
css/cs-scan.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
css/cs-visibility.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
css/cs.min.css CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
customsidebars.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Custom Sidebars
4
  * Plugin URI: https://wordpress.org/plugins/custom-sidebars/
5
  * Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
6
- * Version: 3.0.8.1
7
  * Author: WPMU DEV
8
  * Author URI: http://premium.wpmudev.org/
9
  * Textdomain: custom-sidebars
3
  * Plugin Name: Custom Sidebars
4
  * Plugin URI: https://wordpress.org/plugins/custom-sidebars/
5
  * Description: Allows you to create widgetized areas and custom sidebars. Replace whole sidebars or single widgets for specific posts and pages.
6
+ * Version: 3.0.9
7
  * Author: WPMU DEV
8
  * Author URI: http://premium.wpmudev.org/
9
  * Textdomain: custom-sidebars
inc/class-custom-sidebars-cloning.php CHANGED
@@ -65,7 +65,11 @@ class CustomSidebarsCloning {
65
  );
66
 
67
  // Load the javascript support file for this module.
68
- lib3()->ui->add( CSB_JS_URL . 'cs-cloning.min.js', 'widgets.php' );
 
 
 
 
69
  lib3()->ui->add( CSB_CSS_URL . 'cs-cloning.css', 'widgets.php' );
70
  }
71
  }
65
  );
66
 
67
  // Load the javascript support file for this module.
68
+ $javascript_file = 'cs-cloning.min.js';
69
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
70
+ $javascript_file = 'cs-cloning.js';
71
+ }
72
+ lib3()->ui->add( CSB_JS_URL . $javascript_file, 'widgets.php' );
73
  lib3()->ui->add( CSB_CSS_URL . 'cs-cloning.css', 'widgets.php' );
74
  }
75
  }
inc/class-custom-sidebars-editor.php CHANGED
@@ -9,6 +9,13 @@ class CustomSidebarsEditor extends CustomSidebars {
9
 
10
  private $modifiable = null;
11
 
 
 
 
 
 
 
 
12
  /**
13
  * Returns the singleton object.
14
  *
@@ -51,37 +58,49 @@ class CustomSidebarsEditor extends CustomSidebars {
51
  array( $this, 'handle_ajax' )
52
  );
53
 
54
- // Add a custom column to post list.
55
- $posttypes = self::get_post_types( 'objects' );
56
- foreach ( $posttypes as $pt ) {
57
- add_filter(
58
- 'manage_' . $pt->name . '_posts_columns',
59
- array( $this, 'post_columns' )
60
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  add_action(
63
- 'manage_' . $pt->name . '_posts_custom_column',
64
- array( $this, 'post_column_content' ),
65
- 10, 2
66
  );
67
- }
68
- /** This action is documented in wp-admin/includes/screen.php */
69
- add_filter( 'default_hidden_columns', array( $this, 'default_hidden_columns' ), 10, 2 );
70
-
71
- add_action( 'quick_edit_custom_box', array( $this, 'post_quick_edit' ), 10, 2 );
72
- add_action( 'bulk_edit_custom_box', array( $this, 'post_bulk_edit' ), 10, 2 );
73
 
74
- add_action(
75
- 'admin_footer',
76
- array( $this, 'post_quick_edit_js' )
77
- );
 
 
 
78
 
79
  /**
80
- * Bulk Edit save
81
- *
82
- * @since 3.0.8
83
  */
84
- add_action( 'save_post', array( $this, 'bulk_edit_save' ) );
 
85
  }
86
 
87
  /**
@@ -198,9 +217,14 @@ class CustomSidebarsEditor extends CustomSidebars {
198
  __( 'You have no permission to do this operation.', 'custom-sidebars' )
199
  );
200
  }
 
201
  $sidebars = self::get_custom_sidebars();
202
  $sb_id = $req->id;
203
- $sb_desc = stripslashes( trim( @$_POST['description'] ) );
 
 
 
 
204
 
205
  if ( function_exists( 'mb_substr' ) ) {
206
  $sb_name = mb_substr( stripslashes( trim( @$data['name'] ) ), 0, 40 );
@@ -307,8 +331,11 @@ class CustomSidebarsEditor extends CustomSidebars {
307
  /**
308
  * Delete the specified sidebar and update the response object.
309
  *
310
- * @since 2.0
 
 
311
  * @param object $req Initial response object.
 
312
  * @return object Updated response object.
313
  */
314
  private function delete_item( $req, $data ) {
@@ -441,6 +468,7 @@ class CustomSidebarsEditor extends CustomSidebars {
441
  break;
442
  }
443
  }
 
444
  foreach ( $raw_taxonomies['custom'] as $taxonomy ) {
445
  if ( in_array( $taxonomy->labels->singular_name, $default_taxonomies ) ) {
446
  $archive_type[ '_taxonomy_'.$taxonomy->name ] = sprintf( __( '%s Archives', 'custom-sidebars' ), ucfirst( $taxonomy->name ) );
@@ -549,7 +577,7 @@ class CustomSidebarsEditor extends CustomSidebars {
549
  if ( 'category' == $t->name ) {
550
  if ( isset( $defaults['category_archive'] ) ) {
551
  $sel_archive = $defaults['category_archive'];
552
- $archives[ $key ] = array(
553
  'name' => sprintf( __( '%s Archives', 'custom-sidebars' ), $t->labels->singular_name ),
554
  'archive' => self::get_array( $sel_archive ),
555
  );
@@ -590,8 +618,10 @@ class CustomSidebarsEditor extends CustomSidebars {
590
  $sidebars = $options['modifiable'];
591
  $raw_posttype = self::get_post_types( 'objects' );
592
  $raw_cat = self::get_all_categories();
593
- $raw_taxonomies = self::get_taxonomies();
594
  $data = array();
 
 
 
595
 
596
  foreach ( $_POST as $key => $value ) {
597
  if ( strlen( $key ) > 8 && '___cs___' == substr( $key, 0, 8 ) ) {
@@ -716,7 +746,7 @@ class CustomSidebarsEditor extends CustomSidebars {
716
  *
717
  * @since 3.0.7
718
  */
719
- foreach ( $raw_taxonomies as $taxonomy ) {
720
  $key = '_taxonomy_'.$taxonomy;
721
  if (
722
  isset( $data['arc'][ $sb_id ] )
@@ -725,12 +755,13 @@ class CustomSidebarsEditor extends CustomSidebars {
725
  ) {
726
  $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] = $req->id;
727
  } elseif (
728
- isset( $options['taxonomies_archive'][ $key ][ $sb_id ] ) &&
729
- $options['taxonomies_archive'][ $key ][ $sb_id ] == $req->id
730
  ) {
731
  unset( $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] );
732
  }
733
  }
 
734
  /**
735
  * category Archive
736
  *
@@ -743,8 +774,8 @@ class CustomSidebarsEditor extends CustomSidebars {
743
  ) {
744
  $options['category_archive'][ $sb_id ] = $req->id;
745
  } elseif (
746
- isset( $options['category_archive']['_category'][ $sb_id ] ) &&
747
- $options['category_archive']['category_archive'][ $sb_id ] == $req->id
748
  ) {
749
  unset( $options['category_archive'][ $sb_id ] );
750
  }
@@ -783,6 +814,11 @@ class CustomSidebarsEditor extends CustomSidebars {
783
  return false;
784
  }
785
 
 
 
 
 
 
786
  $pt_obj = get_post_type_object( $post_type );
787
  if ( $pt_obj->publicly_queryable || $pt_obj->public ) {
788
  add_meta_box(
@@ -817,6 +853,14 @@ class CustomSidebarsEditor extends CustomSidebars {
817
  * @param string $type Which form to display. 'metabox/quick-edit/col-sidebars'.
818
  */
819
  protected function print_sidebars_form( $post_id, $type = 'metabox' ) {
 
 
 
 
 
 
 
 
820
  global $wp_registered_sidebars;
821
  $available = CustomSidebars::sort_sidebars_by_name( $wp_registered_sidebars );
822
  $replacements = self::get_replacements( $post_id );
@@ -873,9 +917,16 @@ class CustomSidebarsEditor extends CustomSidebars {
873
  /*
874
  * 'editpost' .. Saved from full Post-Editor screen.
875
  * 'inline-save' .. Saved via the quick-edit form.
876
- * We do not (yet) offer a bulk-editing option for custom sidebars.
877
  */
878
- if ( ( isset( $_POST['action'] ) && 'inline-save' == $_POST['action'] ) || 'editpost' != $action ) {
 
 
 
 
 
 
 
 
879
  return $post_id;
880
  }
881
 
@@ -1030,7 +1081,6 @@ class CustomSidebarsEditor extends CustomSidebars {
1030
  return $sidebar;
1031
  }
1032
 
1033
-
1034
  //
1035
  // ========== Custom column an Quick-Edit fields for post list.
1036
  // http://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu
@@ -1233,4 +1283,81 @@ class CustomSidebarsEditor extends CustomSidebars {
1233
  }
1234
  CustomSidebars::set_post_meta( $post_id, $data );
1235
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1236
  };
9
 
10
  private $modifiable = null;
11
 
12
+ /**
13
+ * Metabox roles name
14
+ *
15
+ * @since 3.0.9
16
+ */
17
+ private $metabox_roles_name = 'custom_sidebars_metabox_roles';
18
+
19
  /**
20
  * Returns the singleton object.
21
  *
58
  array( $this, 'handle_ajax' )
59
  );
60
 
61
+ /**
62
+ * Check settings
63
+ */
64
+ $user_can_save = $this->current_user_can_update_custom_sidebars();
65
+ if ( $user_can_save ) {
66
+ // Add a custom column to post list.
67
+ $posttypes = self::get_post_types( 'objects' );
68
+ foreach ( $posttypes as $pt ) {
69
+ add_filter(
70
+ 'manage_' . $pt->name . '_posts_columns',
71
+ array( $this, 'post_columns' )
72
+ );
73
+
74
+ add_action(
75
+ 'manage_' . $pt->name . '_posts_custom_column',
76
+ array( $this, 'post_column_content' ),
77
+ 10, 2
78
+ );
79
+ }
80
+ /** This action is documented in wp-admin/includes/screen.php */
81
+ add_filter( 'default_hidden_columns', array( $this, 'default_hidden_columns' ), 10, 2 );
82
+
83
+ add_action( 'quick_edit_custom_box', array( $this, 'post_quick_edit' ), 10, 2 );
84
+ add_action( 'bulk_edit_custom_box', array( $this, 'post_bulk_edit' ), 10, 2 );
85
 
86
  add_action(
87
+ 'admin_footer',
88
+ array( $this, 'post_quick_edit_js' )
 
89
  );
 
 
 
 
 
 
90
 
91
+ /**
92
+ * Bulk Edit save
93
+ *
94
+ * @since 3.0.8
95
+ */
96
+ add_action( 'save_post', array( $this, 'bulk_edit_save' ) );
97
+ }
98
 
99
  /**
100
+ * metabox role
 
 
101
  */
102
+ add_filter( 'screen_settings', array( $this, 'add_capabilities_select_box' ), 10, 2 );
103
+ add_action( 'wp_ajax_custom_sidebars_metabox_roles', array( $this, 'update_custom_sidebars_metabox_roles' ) );
104
  }
105
 
106
  /**
217
  __( 'You have no permission to do this operation.', 'custom-sidebars' )
218
  );
219
  }
220
+
221
  $sidebars = self::get_custom_sidebars();
222
  $sb_id = $req->id;
223
+
224
+ $sb_desc = '';
225
+ if ( isset( $data['description'] ) ) {
226
+ $sb_desc = stripslashes( trim( $data['description'] ) );
227
+ }
228
 
229
  if ( function_exists( 'mb_substr' ) ) {
230
  $sb_name = mb_substr( stripslashes( trim( @$data['name'] ) ), 0, 40 );
331
  /**
332
  * Delete the specified sidebar and update the response object.
333
  *
334
+ * @since 2.0
335
+ * @since 3.0.8.1 Added the $data param.
336
+ *
337
  * @param object $req Initial response object.
338
+ * @param array $data Sidebar data to save (typically this is $_POST).
339
  * @return object Updated response object.
340
  */
341
  private function delete_item( $req, $data ) {
468
  break;
469
  }
470
  }
471
+
472
  foreach ( $raw_taxonomies['custom'] as $taxonomy ) {
473
  if ( in_array( $taxonomy->labels->singular_name, $default_taxonomies ) ) {
474
  $archive_type[ '_taxonomy_'.$taxonomy->name ] = sprintf( __( '%s Archives', 'custom-sidebars' ), ucfirst( $taxonomy->name ) );
577
  if ( 'category' == $t->name ) {
578
  if ( isset( $defaults['category_archive'] ) ) {
579
  $sel_archive = $defaults['category_archive'];
580
+ $archives['_category'] = array(
581
  'name' => sprintf( __( '%s Archives', 'custom-sidebars' ), $t->labels->singular_name ),
582
  'archive' => self::get_array( $sel_archive ),
583
  );
618
  $sidebars = $options['modifiable'];
619
  $raw_posttype = self::get_post_types( 'objects' );
620
  $raw_cat = self::get_all_categories();
 
621
  $data = array();
622
+ $raw_taxonomies = array(
623
+ 'custom' => self::get_taxonomies( 'names', false ),
624
+ );
625
 
626
  foreach ( $_POST as $key => $value ) {
627
  if ( strlen( $key ) > 8 && '___cs___' == substr( $key, 0, 8 ) ) {
746
  *
747
  * @since 3.0.7
748
  */
749
+ foreach ( $raw_taxonomies['custom'] as $taxonomy ) {
750
  $key = '_taxonomy_'.$taxonomy;
751
  if (
752
  isset( $data['arc'][ $sb_id ] )
755
  ) {
756
  $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] = $req->id;
757
  } elseif (
758
+ isset( $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] ) &&
759
+ $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] == $req->id
760
  ) {
761
  unset( $options['taxonomies_archive'][ $taxonomy ][ $sb_id ] );
762
  }
763
  }
764
+
765
  /**
766
  * category Archive
767
  *
774
  ) {
775
  $options['category_archive'][ $sb_id ] = $req->id;
776
  } elseif (
777
+ isset( $options['category_archive'][ $sb_id ] ) &&
778
+ $options['category_archive'][ $sb_id ] == $req->id
779
  ) {
780
  unset( $options['category_archive'][ $sb_id ] );
781
  }
814
  return false;
815
  }
816
 
817
+ $show_meta_box = $this->current_user_can_update_custom_sidebars();
818
+ if ( ! $show_meta_box ) {
819
+ return false;
820
+ }
821
+
822
  $pt_obj = get_post_type_object( $post_type );
823
  if ( $pt_obj->publicly_queryable || $pt_obj->public ) {
824
  add_meta_box(
853
  * @param string $type Which form to display. 'metabox/quick-edit/col-sidebars'.
854
  */
855
  protected function print_sidebars_form( $post_id, $type = 'metabox' ) {
856
+ /**
857
+ * Check settings
858
+ */
859
+ $user_can_save = $this->current_user_can_update_custom_sidebars();
860
+ if ( ! $user_can_save ) {
861
+ return;
862
+ }
863
+
864
  global $wp_registered_sidebars;
865
  $available = CustomSidebars::sort_sidebars_by_name( $wp_registered_sidebars );
866
  $replacements = self::get_replacements( $post_id );
917
  /*
918
  * 'editpost' .. Saved from full Post-Editor screen.
919
  * 'inline-save' .. Saved via the quick-edit form.
 
920
  */
921
+ if ( ( isset( $_POST['action'] ) && 'inline-save' != $_POST['action'] ) && 'editpost' != $action ) {
922
+ return $post_id;
923
+ }
924
+
925
+ /**
926
+ * Check settings
927
+ */
928
+ $user_can_save = $this->current_user_can_update_custom_sidebars();
929
+ if ( ! $user_can_save ) {
930
  return $post_id;
931
  }
932
 
1081
  return $sidebar;
1082
  }
1083
 
 
1084
  //
1085
  // ========== Custom column an Quick-Edit fields for post list.
1086
  // http://shibashake.com/wordpress-theme/expand-the-wordpress-quick-edit-menu
1283
  }
1284
  CustomSidebars::set_post_meta( $post_id, $data );
1285
  }
1286
+
1287
+ /**
1288
+ * Add capabilities for options on widgets.php
1289
+ *
1290
+ * @param string $screen_settings Screen settings.
1291
+ * @param WP_Screen $screen WP_Screen object.
1292
+ */
1293
+ public function add_capabilities_select_box( $screen_settings, $screen ) {
1294
+ if ( 'widgets' == $screen->base && current_user_can( 'manage_options' ) ) {
1295
+ $allowed = get_option( $this->metabox_roles_name, 'any' );
1296
+ $roles = get_editable_roles();
1297
+ $screen_settings .= '<fieldset class="metabox-prefs cs-roles">';
1298
+ $screen_settings .= wp_nonce_field( $this->metabox_roles_name, $this->metabox_roles_name, false, false );
1299
+ $screen_settings .= sprintf( '<legend>%s</legend>', __( 'Custom sidebars configuration is allowed for:', 'custom-sidebars' ) );
1300
+ foreach ( $roles as $role => $data ) {
1301
+ if ( isset( $data['capabilities'][ self::$cap_required ] ) && $data['capabilities'][ self::$cap_required ] ) {
1302
+ $checked = false;
1303
+ if ( is_string( $allowed ) && 'any' == $allowed ) {
1304
+ $checked = true;
1305
+ } else if ( is_array( $allowed ) && in_array( $role, $allowed ) ) {
1306
+ $checked = true;
1307
+ }
1308
+ $screen_settings .= sprintf(
1309
+ '<label><input type="checkbox" name="cs-roles[]" value="%s" %s /> %s</label>',
1310
+ esc_attr( $role ),
1311
+ checked( $checked, true, false ),
1312
+ esc_html( $data['name'] )
1313
+ );
1314
+ }
1315
+ }
1316
+ $screen_settings .= '</fieldset>';
1317
+ }
1318
+ return $screen_settings;
1319
+ }
1320
+
1321
+ /**
1322
+ * Update capabilities select box
1323
+ *
1324
+ * @since 3.0.9
1325
+ */
1326
+ public function update_custom_sidebars_metabox_roles() {
1327
+ if ( ! isset( $_REQUEST['_wpnonce'] ) || ! isset( $_REQUEST['fields'] ) ) {
1328
+ wp_send_json_error();
1329
+ }
1330
+ $value = array();
1331
+ foreach ( $_REQUEST['fields'] as $role => $status ) {
1332
+ if ( 'true' == $status ) {
1333
+ $value[] = $role;
1334
+ }
1335
+ }
1336
+ $status = add_option( $this->metabox_roles_name, $value, '', 'no' );
1337
+ if ( ! $status ) {
1338
+ update_option( $this->metabox_roles_name, $value );
1339
+ }
1340
+ wp_send_json_success();
1341
+ }
1342
+
1343
+ /**
1344
+ * Check ability to save sidebars
1345
+ *
1346
+ * @since 3.0.9
1347
+ */
1348
+ public function current_user_can_update_custom_sidebars() {
1349
+ $allowed = get_option( $this->metabox_roles_name, 'any' );
1350
+ if ( is_string( $allowed ) && 'any' == $allowed ) {
1351
+ return true;
1352
+ } else {
1353
+ $current_user = wp_get_current_user();
1354
+ $current_user_roles = (array) $current_user->roles;
1355
+ foreach ( $allowed as $role ) {
1356
+ if ( in_array( $role, $current_user_roles ) ) {
1357
+ return true;
1358
+ }
1359
+ }
1360
+ }
1361
+ return false;
1362
+ }
1363
  };
inc/class-custom-sidebars-visibility.php CHANGED
@@ -52,7 +52,11 @@ class CustomSidebarsVisibility extends CustomSidebars {
52
  $url = explode( '/', $_SERVER['SCRIPT_NAME'] );
53
  $url = array_pop( $url );
54
  }
55
- lib3()->ui->add( CSB_JS_URL . 'cs-visibility.min.js', $url );
 
 
 
 
56
  lib3()->ui->add( CSB_CSS_URL . 'cs-visibility.css', $url );
57
 
58
  // Custom Sidebars Ajax request.
@@ -149,7 +153,7 @@ class CustomSidebarsVisibility extends CustomSidebars {
149
  $membership_levels = $this->get_membership_levels();
150
  $membership2_items = $this->get_membership2_items();
151
  $pagetype_list = array(
152
- 'frontpage' => __( 'aFront Page', 'custom-sidebars' ),
153
  'home' => __( 'Post Index', 'custom-sidebars' ),
154
  'single' => __( 'Single page', 'custom-sidebars' ),
155
  //'posts' => __( 'Posts page', 'custom-sidebars' ), "Posts page" is same as "Post Index"...
52
  $url = explode( '/', $_SERVER['SCRIPT_NAME'] );
53
  $url = array_pop( $url );
54
  }
55
+ $javascript_file = 'cs-visibility.min.js';
56
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
57
+ $javascript_file = 'cs-visibility.js';
58
+ }
59
+ lib3()->ui->add( CSB_JS_URL . $javascript_file, $url );
60
  lib3()->ui->add( CSB_CSS_URL . 'cs-visibility.css', $url );
61
 
62
  // Custom Sidebars Ajax request.
153
  $membership_levels = $this->get_membership_levels();
154
  $membership2_items = $this->get_membership2_items();
155
  $pagetype_list = array(
156
+ 'frontpage' => __( 'Front Page', 'custom-sidebars' ),
157
  'home' => __( 'Post Index', 'custom-sidebars' ),
158
  'single' => __( 'Single page', 'custom-sidebars' ),
159
  //'posts' => __( 'Posts page', 'custom-sidebars' ), "Posts page" is same as "Post Index"...
inc/class-custom-sidebars.php CHANGED
@@ -141,9 +141,16 @@ class CustomSidebars {
141
  'widgets'
142
  );
143
  } else {
 
 
 
 
 
 
 
144
  // Load javascripts/css files
145
  lib3()->ui->add( 'select', 'widgets.php' );
146
- lib3()->ui->add( CSB_JS_URL . 'cs.min.js', 'widgets.php' );
147
  lib3()->ui->add( CSB_CSS_URL . 'cs.css', 'widgets.php' );
148
  lib3()->ui->add( CSB_CSS_URL . 'cs.css', 'edit.php' );
149
 
141
  'widgets'
142
  );
143
  } else {
144
+ /**
145
+ * Main JavaScript file
146
+ */
147
+ $javascript_file = 'cs.min.js';
148
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
149
+ $javascript_file = 'cs.js';
150
+ }
151
  // Load javascripts/css files
152
  lib3()->ui->add( 'select', 'widgets.php' );
153
+ lib3()->ui->add( CSB_JS_URL . $javascript_file, 'widgets.php' );
154
  lib3()->ui->add( CSB_CSS_URL . 'cs.css', 'widgets.php' );
155
  lib3()->ui->add( CSB_CSS_URL . 'cs.css', 'edit.php' );
156
 
js/cs-cloning.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
js/cs-cloning.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
js/cs-visibility.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global jQuery:false */
js/cs-visibility.min.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
js/cs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global window:false */
@@ -932,7 +932,6 @@ window.csSidebars = null;
932
  // Deletes the sidebar and closes the confirmation popup.
933
  function delete_sidebar() {
934
  popup.loading( true );
935
-
936
  ajax.reset()
937
  .data({
938
  'do': 'delete',
@@ -1559,3 +1558,27 @@ jQuery.fn.sortElements = (function(){
1559
 
1560
  })();
1561
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
  /*global window:false */
932
  // Deletes the sidebar and closes the confirmation popup.
933
  function delete_sidebar() {
934
  popup.loading( true );
 
935
  ajax.reset()
936
  .data({
937
  'do': 'delete',
1558
 
1559
  })();
1560
 
1561
+
1562
+ /*global console:false */
1563
+ /*global document:false */
1564
+ /*global ajaxurl:false */
1565
+
1566
+ /**
1567
+ * Handle "Custom sidebars configuration is allowed for:" option on
1568
+ * widgets screen options.
1569
+ */
1570
+ (function($){
1571
+ jQuery(document).ready( function($) {
1572
+ $('#screen-options-wrap .cs-roles input[type=checkbox]').on( 'change', function() {
1573
+ var data = {
1574
+ 'action': 'custom_sidebars_metabox_roles',
1575
+ '_wpnonce': $('#custom_sidebars_metabox_roles').val(),
1576
+ 'fields': {}
1577
+ };
1578
+ $('#screen-options-wrap .cs-roles input[type=checkbox]').each( function() {
1579
+ data.fields[$(this).val()] = this.checked;
1580
+ });
1581
+ $.post( ajaxurl, data );
1582
+ });
1583
+ });
1584
+ })(jQuery);
js/cs.min.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! Custom Sidebars - v3.0.8.1
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
5
- function trim(a){a=a.replace(/^\s\s*/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a}function CsSidebar(a,b){var c;this.id=a.split("%").join("\\%"),this.type=b,this.sb=jQuery("#"+this.id),this.widgets="",this.name=trim(this.sb.find(".sidebar-name h2").text()),this.description=trim(this.sb.find(".sidebar-description").text()),c="custom"===b?window.csSidebars.extras.find(".cs-custom-sidebar").clone():window.csSidebars.extras.find(".cs-theme-sidebar").clone(),this.sb.parent().append(c),c.find("label").each(function(){var b=jQuery(this);window.csSidebars.addIdToLabel(b,a)})}CsSidebar.prototype.getID=function(){return this.id.split("\\").join("")},window.csSidebars=null,function(a){window.csSidebars={sidebars:[],sidebar_prefix:"cs-",edit_form:null,delete_form:null,export_form:null,location_form:null,right:null,extras:null,action_handlers:{},init:function(){"undefined"!=typeof csSidebarsData&&csSidebars.initControls().initTopTools().initSidebars().initToolbars().initColumns()},initControls:function(){return csSidebars.right=jQuery("#widgets-right"),csSidebars.extras=jQuery("#cs-widgets-extra"),null===csSidebars.edit_form&&(csSidebars.edit_form=csSidebars.extras.find(".cs-editor").clone(),csSidebars.extras.find(".cs-editor").remove()),null===csSidebars.delete_form&&(csSidebars.delete_form=csSidebars.extras.find(".cs-delete").clone(),csSidebars.extras.find(".cs-delete").remove()),null===csSidebars.export_form&&(csSidebars.export_form=csSidebars.extras.find(".cs-export").clone(),csSidebars.extras.find(".cs-export").remove()),null===csSidebars.location_form&&(csSidebars.location_form=csSidebars.extras.find(".cs-location").clone(),csSidebars.extras.find(".cs-location").remove()),jQuery("#cs-title-options").detach().prependTo(csSidebars.right),csSidebars},initColumns:function(){function a(){var a=jQuery(this),b=a.closest(".sidebars-column-1, .sidebars-column-2"),c=b.data("sort-dir");c="asc"===c?"desc":"asc",csSidebars.sort_sidebars(b,c)}var b=csSidebars.right.find(".sidebars-column-1"),c=csSidebars.right.find(".sidebars-column-2"),d=jQuery('<div class="cs-title"><h2></h2></div>'),e=csSidebars.right.find(".widgets-holder-wrap");c.length||(c=jQuery('<div class="sidebars-column-2"></div>'),c.appendTo(csSidebars.right)),d.find("h2").append('<span class="cs-title-val"></span><i class="cs-icon dashicons dashicons-sort"></i>').css({cursor:"pointer"}),d.clone().prependTo(b).click(a).find(".cs-title-val").text(csSidebarsData.custom_sidebars),d.clone().prependTo(c).click(a).find(".cs-title-val").text(csSidebarsData.theme_sidebars),b=jQuery('<div class="inner"></div>').appendTo(b),c=jQuery('<div class="inner"></div>').appendTo(c),e.each(function(){var a=jQuery(this),d=a.find(".widgets-sortables");csSidebars.isCustomSidebar(d)?a.appendTo(b):a.appendTo(c)})},initSidebars:function(){return csSidebars.right.find(".widgets-sortables").each(function(){var a,b,c=!1,d=jQuery(this),e=d.attr("id");if(!0!==d.data("cs-init"))if(d.data("cs-init",!0),csSidebars.isCustomSidebar(this))b=csSidebars.add(e,"custom");else{b=csSidebars.add(e,"theme");for(a in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(a)&&csSidebarsData.replaceable[a]===e){c=!0;break}csSidebars.setReplaceable(b,c,!1)}}),csSidebars},initTopTools:function(){var a=jQuery(".btn-create-sidebar"),b=jQuery(".btn-export"),c=jQuery(".cs-options"),d=jQuery('<input type="search" class="cs-filter" />'),e={};return a.click(function(){e.id="",e.title=csSidebarsData.title_new,e.button=csSidebarsData.btn_new,e.description="",e.name="",csSidebars.showEditor(e)}),b.click(csSidebars.showExport),d.appendTo(c).attr("placeholder",csSidebarsData.filter).keyup(csSidebars.filter_sidebars).on("search",csSidebars.filter_sidebars),csSidebars},initToolbars:function(){function a(a){var b=jQuery(a.target).closest(".cs-tool"),c=b.data("action"),d=csSidebars.getIdFromEditbar(b),e=csSidebars.find(d);return!csSidebars.handleAction(c,e)}return csSidebars.registerAction("edit",csSidebars.showEditor),csSidebars.registerAction("location",csSidebars.showLocations),csSidebars.registerAction("delete",csSidebars.showRemove),csSidebars.registerAction("replaceable",csSidebars.setReplaceable),csSidebars.right.on("click",".cs-tool",a),csSidebars},handleAction:function(a,b){return"function"==typeof csSidebars.action_handlers[a]&&!!csSidebars.action_handlers[a](b)},registerAction:function(a,b){csSidebars.action_handlers[a]=b},showAjaxError:function(a){var b={};b.message=csSidebarsData.ajax_error,b.details=a,b.parent="#widgets-right",b.insert_after="#cs-title-options",b.id="editor",b.type="err",wpmUi.message(b)},sort_sidebars:function(a,b){var c=a.find(".widgets-holder-wrap"),d=a.find(".cs-title .cs-icon");c.sortElements(function(a,c){var d=jQuery(a).find(".sidebar-name h2").text(),e=jQuery(c).find(".sidebar-name h2").text();return"asc"===b?d>e?1:-1:d<e?1:-1}),a.data("sort-dir",b),"asc"===b?d.removeClass("dashicons-arrow-down dashicons-sort").addClass("dashicons-arrow-up"):d.removeClass("dashicons-arrow-up dashicons-sort").addClass("dashicons-arrow-down")},filter_sidebars:function(a){var b=jQuery("input.cs-filter").val().toLowerCase();csSidebars.right.find(".widgets-holder-wrap").each(function(){var a=jQuery(this);-1!==a.find(".sidebar-name h2").text().toLowerCase().indexOf(b)?a.show():a.hide()}),jQuery(window).trigger("cs-resize")},showEditor:function(b){function c(){i.$().removeClass("csb-has-more"),i.size(782,215)}function d(){i.$().addClass("csb-has-more"),i.size(782,545)}function e(){jQuery(this).prop("checked")?d():c()}function f(a,b,c){return i.loading(!1),!!a&&(b?(a.sidebar&&(a=a.sidebar),a.id&&i.$().find("#csb-id").val(a.id),a.name&&i.$().find("#csb-name").val(a.name),a.description&&i.$().find("#csb-description").val(a.description),a.before_title&&i.$().find("#csb-before-title").val(a.before_title),a.after_title&&i.$().find("#csb-after-title").val(a.after_title),a.before_widget&&i.$().find("#csb-before-widget").val(a.before_widget),a.after_widget&&i.$().find("#csb-after-widget").val(a.after_widget),void(a.button&&i.$().find(".btn-save").text(a.button))):(i.destroy(),csSidebars.showAjaxError(a),!1))}function g(b,c,d){var e,f={};i.loading(!1),i.destroy(),f.message=b.message,f.parent="#widgets-right",f.insert_after="#cs-title-options",f.id="editor",c?"update"===b.action?(e=csSidebars.find(b.data.id),csSidebars.updateSidebar(e,b.data)):"insert"===b.action&&(csSidebars.insertSidebar(b.data),a(".cs-wrap .custom-sidebars-add-new").detach()):f.type="err",wpmUi.message(f)}function h(){var a=i.$().find("form");return i.loading(!0),j.reset().data(a).ondone(g).load_json(),!1}var i=null,j=null;return b instanceof CsSidebar&&(b={id:b.getID(),title:csSidebarsData.title_edit.replace("[Sidebar]",b.name),button:csSidebarsData.btn_edit}),i=wpmUi.popup().modal(!0).title(b.title).onshow(c).content(csSidebars.edit_form),c(),f(b,!0,null),j=wpmUi.ajax(null,"cs-ajax"),b.id&&(i.loading(!0),j.reset().data({do:"get",sb:b.id}).ondone(f).load_json()),i.show(),i.$().find("#csb-name").focus(),i.$().on("keypress","#csb-name",function(b){13===b.keyCode&&0<a(this).val().length&&a("#csb-description").focus()}),i.$().on("keypress","#csb-description",function(a){13===a.keyCode&&i.$(".btn-save").click()}),i.$().on("click","#csb-more",e),i.$().on("click",".btn-save",h),i.$().on("click",".btn-cancel",i.destroy),!0},updateSidebar:function(a,b){return a.sb.find(".sidebar-name h2").text(b.name),a.sb.find(".sidebar-description").html('<p class="description"></p>').find(".description").text(b.description),csSidebars},insertSidebar:function(a){var b=jQuery('<div class="widgets-holder-wrap"></div>'),c=jQuery('<div class="widgets-sortables ui-sortable"></div>'),d=jQuery('<div class="sidebar-name"><div class="sidebar-name-arrow"><br></div><h2></h2></div>'),e=jQuery('<div class="sidebar-description"></div>'),f=csSidebars.right.find(".sidebars-column-1 > .inner:first");return c.attr("id",a.id),d.find("h2").text(a.name),e.html('<p class="description"></p>').find(".description").text(a.description),d.appendTo(c),e.appendTo(c),c.appendTo(b),b.prependTo(f),jQuery("#widgets-right .sidebar-name").unbind("click"),jQuery("#widgets-left .sidebar-name").unbind("click"),jQuery(document.body).unbind("click.widgets-toggle"),jQuery(".widgets-chooser").off("click.widgets-chooser").off("keyup.widgets-chooser"),jQuery("#available-widgets .widget .widget-title").off("click.widgets-chooser"),jQuery(".widgets-chooser-sidebars").empty(),window.wpWidgets.init(),csSidebars.initSidebars(),csSidebars},showExport:function(){function a(a){var b=jQuery(this).closest("form");return h.reset().data(b).load_http(),g.destroy(),a.preventDefault(),!1}function b(a,b,c){var d={};g.loading(!1),b?g.size(900,600).content(a.html):(d.message=a.message,d.parent=g.$().find(".wpmui-wnd-content"),d.insert_after=!1,d.id="export",d.class="wpmui-wnd-err",d.type="err",wpmUi.message(d))}function c(a){var c=jQuery(this).closest("form");return g.loading(!0),h.reset().data(c).ondone(b).load_json("cs-ajax"),a.preventDefault(),!1}function d(){var a=jQuery(this),b=a.prop("checked"),c=g.$().find(".column-widgets, .import-widgets");b?c.show():c.hide()}function e(){g.size(782,480),g.content(csSidebars.export_form)}function f(){var a=g.$().find(".frm-import");g.loading(!0),h.reset().data(a).load_http("_self")}var g=null,h=null;return g=wpmUi.popup().modal(!0).size(782,480).title(csSidebarsData.title_export).content(csSidebars.export_form).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("submit",".frm-export",a),g.$().on("submit",".frm-preview-import",c),g.$().on("change","#import-widgets",d),g.$().on("click",".btn-cancel",e),g.$().on("click",".btn-import",f),!0},showRemove:function(b){function c(a){a.find(".name").text(j)}function d(){g.loading(!1),g.destroy()}function e(a,b,c){var d={};g.loading(!1),g.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b?(csSidebars.right.find("#"+i).closest(".widgets-holder-wrap").remove(),csSidebars.remove(i),"delete"===a.action&&window.csSidebars.showGetStartedBox()):d.type="err",wpmUi.message(d)}function f(){g.loading(!0),h.reset().data({do:"delete",sb:i,_wpnonce:a("#_wp_nonce_cs_delete_sidebar").val()}).ondone(e).load_json()}var g=null,h=null,i=b.getID(),j=b.name;return g=wpmUi.popup().modal(!0).size(560,160).title(csSidebarsData.title_delete).content(csSidebars.delete_form).onshow(c).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("click",".btn-cancel",d),g.$().on("click",".btn-delete",f),!0},showLocations:function(a){function b(a,b,c){function d(a,b,c){var d=jQuery("<option></option>");d.attr("value",c).text(a.name),b.append(d)}function e(a,b,c,d){var e=d.closest(".cs-replaceable").filter("."+b),f=e.find('option[value="'+c+'"]'),g=e.find("optgroup.used"),h=e.find(".detail-toggle");a===j?(f.prop("selected",!0),!0!==h.prop("checked")&&(h.prop("checked",!0),e.addClass("open"),wpmUi.upgrade_multiselect(e))):(g.length||(g=jQuery('<optgroup class="used">').attr("label",e.data("lbl-used")).appendTo(e.find(".details select"))),f.detach().appendTo(g))}var g,h,i;if(f.loading(!1),!b)return f.destroy(),void csSidebars.showAjaxError(a);f.$().find(".sb-name").text(a.sidebar.name);var j=a.sidebar.id;f.$().find(".message.no-sidebars").hide();var k=0,l=f.$().find(".cs-replaceable");l.hide(),a.replaceable=wpmUi.obj(a.replaceable);for(var m in a.replaceable)a.replaceable.hasOwnProperty(m)&&(l.filter("."+a.replaceable[m]).show(),k++);0===k&&(f.$().find(".wpmui-box, .message, .button-primary").hide(),f.$().find(".message.no-sidebars").show().parent().addClass("notice notice-error").removeClass("hidden"));var n=f.$().find(".cs-datalist.cs-cat"),o=f.$().find(".cs-datalist.cs-arc-cat"),p=a.categories;o.empty(),n.empty();for(var q in p)d(p[q],o,q),d(p[q],n,q);for(var r in p){if(p[r].single)for(g in p[r].single)e(p[r].single[g],g,r,n);if(p[r].archive)for(g in p[r].archive)e(p[r].archive[g],g,r,o)}var s=f.$().find(".cs-datalist.cs-pt"),t=a.posttypes;s.empty();for(var u in t)h=jQuery("<option></option>"),i=t[u].name,h.attr("value",u).text(i),s.append(h);for(var v in t)if(t[v].single)for(g in t[v].single)e(t[v].single[g],g,v,s);var w=f.$().find(".cs-datalist.cs-arc"),x=a.archives;w.empty();for(var y in x)h=jQuery("<option></option>"),i=x[y].name,h.attr("value",y).text(i),w.append(h);for(var z in x)if(x[z].archive)for(g in x[z].archive)e(x[z].archive[g],g,z,w);var A=f.$().find(".cs-datalist.cs-arc-aut"),B=a.authors;A.empty();for(var C in B)h=jQuery("<option></option>"),i=B[C].name,h.attr("value",C).text(i),A.append(h);for(var D in B)if(B[D].archive)for(g in B[D].archive)e(B[D].archive[g],g,D,A)}function c(a){var b=jQuery(this),c=b.closest(".cs-replaceable"),d=c.find("select");b.prop("checked")?(c.addClass("open"),wpmUi.upgrade_multiselect(c),d.trigger("change.select2")):(c.removeClass("open"),d.val([]))}function d(a,b,c){var d={};f.loading(!1),f.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b||(d.type="err"),wpmUi.message(d)}function e(){f.loading(!0),g.reset().data(h).ondone(d).load_json()}var f=null,g=null,h=null,i=a.getID();return f=wpmUi.popup().modal(!0).size(782,560).title(csSidebarsData.title_location).content(csSidebars.location_form).show(),f.loading(!0),h=f.$().find(".frm-location"),h.find(".sb-id").val(i),g=wpmUi.ajax(null,"cs-ajax"),g.reset().data({do:"get-location",sb:i}).ondone(b).load_json(),f.$().on("click",".detail-toggle",c),f.$().on("click",".btn-save",e),f.$().on("click",".btn-cancel",f.destroy),!0},setReplaceable:function(a,b,c){function d(a,b,c){a instanceof Object&&"object"==typeof a.replaceable&&(csSidebarsData.replaceable=wpmUi.obj(a.replaceable),f.find(".widgets-sortables").each(function(){var a=!1,b=jQuery(this),c=b.attr("id"),d=csSidebars.find(c);for(var e in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(e)&&csSidebarsData.replaceable[e]===c){a=!0;break}csSidebars.setReplaceable(d,a,!1)})),f.find(".cs-toolbar .chk-replaceable").prop("disabled",!1),f.find(".cs-toolbar .btn-replaceable").removeClass("wpmui-loading")}var e,f=csSidebars.right.find(".sidebars-column-2 .widgets-holder-wrap"),g=jQuery(a.sb).closest(".widgets-holder-wrap"),h=g.find(".cs-toolbar .chk-replaceable"),i=g.find(".replace-marker");g.find(".cs-toolbar .btn-replaceable");return void 0===b&&(b=h.prop("checked")),void 0===c&&(c=!0),h.data("active")!==b&&(h.data("active",b),h.prop("checked",b),b?(i.length||jQuery("<div></div>").appendTo(g).attr("data-label",csSidebarsData.lbl_replaceable).addClass("replace-marker"),g.addClass("replaceable")):(i.remove(),g.removeClass("replaceable")),c&&(f.find(".cs-toolbar .chk-replaceable").prop("disabled",!0),f.find(".cs-toolbar .btn-replaceable").addClass("wpmui-loading"),e=wpmUi.ajax(null,"cs-ajax"),e.reset().data({do:"replaceable",state:b,sb:a.getID()}).ondone(d).load_json()),!1)},find:function(a){return csSidebars.sidebars[a]},add:function(a,b){return csSidebars.sidebars[a]=new CsSidebar(a,b),csSidebars.sidebars[a]},remove:function(a){delete csSidebars.sidebars[a]},isCustomSidebar:function(a){return jQuery(a).attr("id").substr(0,csSidebars.sidebar_prefix.length)===csSidebars.sidebar_prefix},addIdToLabel:function(a,b){if(!0!==a.data("label-done")){var c=a.attr("for");a.attr("for",c+b),a.find(".has-label").attr("id",c+b),a.data("label-done",!0)}},getIdFromEditbar:function(a){return a.closest(".widgets-holder-wrap").find(".widgets-sortables:first").attr("id")},showGetStartedBox:function(){if(0===a(".sidebars-column-1 .inner .widgets-holder-wrap").length){var b=wp.template("custom-sidebars-new");a(".sidebars-column-1 .inner").before(b()),a(".custom-sidebars-add-new").on("click",function(){a("button.btn-create-sidebar").click()})}}},jQuery(function(a){a("#csfooter").hide(),a("#widgets-right").length>0&&csSidebars.init(),a(".defaultsContainer").hide(),a("#widgets-right .widgets-sortables").on("sort",function(b,c){a("#widgets-right").top;c.position.top=-a("#widgets-right").css("top")})}),jQuery(document).ready(function(a){window.setTimeout(function(){window.csSidebars.showGetStartedBox()},1e3)})}(jQuery),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}();
1
+ /*! Custom Sidebars - v3.0.9
2
  * https://premium.wpmudev.org/project/custom-sidebars-pro/
3
  * Copyright (c) 2017; * Licensed GPLv2+ */
4
 
5
+ function trim(a){a=a.replace(/^\s\s*/,"");for(var b=a.length-1;b>=0;b--)if(/\S/.test(a.charAt(b))){a=a.substring(0,b+1);break}return a}function CsSidebar(a,b){var c;this.id=a.split("%").join("\\%"),this.type=b,this.sb=jQuery("#"+this.id),this.widgets="",this.name=trim(this.sb.find(".sidebar-name h2").text()),this.description=trim(this.sb.find(".sidebar-description").text()),c="custom"===b?window.csSidebars.extras.find(".cs-custom-sidebar").clone():window.csSidebars.extras.find(".cs-theme-sidebar").clone(),this.sb.parent().append(c),c.find("label").each(function(){var b=jQuery(this);window.csSidebars.addIdToLabel(b,a)})}CsSidebar.prototype.getID=function(){return this.id.split("\\").join("")},window.csSidebars=null,function(a){window.csSidebars={sidebars:[],sidebar_prefix:"cs-",edit_form:null,delete_form:null,export_form:null,location_form:null,right:null,extras:null,action_handlers:{},init:function(){"undefined"!=typeof csSidebarsData&&csSidebars.initControls().initTopTools().initSidebars().initToolbars().initColumns()},initControls:function(){return csSidebars.right=jQuery("#widgets-right"),csSidebars.extras=jQuery("#cs-widgets-extra"),null===csSidebars.edit_form&&(csSidebars.edit_form=csSidebars.extras.find(".cs-editor").clone(),csSidebars.extras.find(".cs-editor").remove()),null===csSidebars.delete_form&&(csSidebars.delete_form=csSidebars.extras.find(".cs-delete").clone(),csSidebars.extras.find(".cs-delete").remove()),null===csSidebars.export_form&&(csSidebars.export_form=csSidebars.extras.find(".cs-export").clone(),csSidebars.extras.find(".cs-export").remove()),null===csSidebars.location_form&&(csSidebars.location_form=csSidebars.extras.find(".cs-location").clone(),csSidebars.extras.find(".cs-location").remove()),jQuery("#cs-title-options").detach().prependTo(csSidebars.right),csSidebars},initColumns:function(){function a(){var a=jQuery(this),b=a.closest(".sidebars-column-1, .sidebars-column-2"),c=b.data("sort-dir");c="asc"===c?"desc":"asc",csSidebars.sort_sidebars(b,c)}var b=csSidebars.right.find(".sidebars-column-1"),c=csSidebars.right.find(".sidebars-column-2"),d=jQuery('<div class="cs-title"><h2></h2></div>'),e=csSidebars.right.find(".widgets-holder-wrap");c.length||(c=jQuery('<div class="sidebars-column-2"></div>'),c.appendTo(csSidebars.right)),d.find("h2").append('<span class="cs-title-val"></span><i class="cs-icon dashicons dashicons-sort"></i>').css({cursor:"pointer"}),d.clone().prependTo(b).click(a).find(".cs-title-val").text(csSidebarsData.custom_sidebars),d.clone().prependTo(c).click(a).find(".cs-title-val").text(csSidebarsData.theme_sidebars),b=jQuery('<div class="inner"></div>').appendTo(b),c=jQuery('<div class="inner"></div>').appendTo(c),e.each(function(){var a=jQuery(this),d=a.find(".widgets-sortables");csSidebars.isCustomSidebar(d)?a.appendTo(b):a.appendTo(c)})},initSidebars:function(){return csSidebars.right.find(".widgets-sortables").each(function(){var a,b,c=!1,d=jQuery(this),e=d.attr("id");if(!0!==d.data("cs-init"))if(d.data("cs-init",!0),csSidebars.isCustomSidebar(this))b=csSidebars.add(e,"custom");else{b=csSidebars.add(e,"theme");for(a in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(a)&&csSidebarsData.replaceable[a]===e){c=!0;break}csSidebars.setReplaceable(b,c,!1)}}),csSidebars},initTopTools:function(){var a=jQuery(".btn-create-sidebar"),b=jQuery(".btn-export"),c=jQuery(".cs-options"),d=jQuery('<input type="search" class="cs-filter" />'),e={};return a.click(function(){e.id="",e.title=csSidebarsData.title_new,e.button=csSidebarsData.btn_new,e.description="",e.name="",csSidebars.showEditor(e)}),b.click(csSidebars.showExport),d.appendTo(c).attr("placeholder",csSidebarsData.filter).keyup(csSidebars.filter_sidebars).on("search",csSidebars.filter_sidebars),csSidebars},initToolbars:function(){function a(a){var b=jQuery(a.target).closest(".cs-tool"),c=b.data("action"),d=csSidebars.getIdFromEditbar(b),e=csSidebars.find(d);return!csSidebars.handleAction(c,e)}return csSidebars.registerAction("edit",csSidebars.showEditor),csSidebars.registerAction("location",csSidebars.showLocations),csSidebars.registerAction("delete",csSidebars.showRemove),csSidebars.registerAction("replaceable",csSidebars.setReplaceable),csSidebars.right.on("click",".cs-tool",a),csSidebars},handleAction:function(a,b){return"function"==typeof csSidebars.action_handlers[a]&&!!csSidebars.action_handlers[a](b)},registerAction:function(a,b){csSidebars.action_handlers[a]=b},showAjaxError:function(a){var b={};b.message=csSidebarsData.ajax_error,b.details=a,b.parent="#widgets-right",b.insert_after="#cs-title-options",b.id="editor",b.type="err",wpmUi.message(b)},sort_sidebars:function(a,b){var c=a.find(".widgets-holder-wrap"),d=a.find(".cs-title .cs-icon");c.sortElements(function(a,c){var d=jQuery(a).find(".sidebar-name h2").text(),e=jQuery(c).find(".sidebar-name h2").text();return"asc"===b?d>e?1:-1:d<e?1:-1}),a.data("sort-dir",b),"asc"===b?d.removeClass("dashicons-arrow-down dashicons-sort").addClass("dashicons-arrow-up"):d.removeClass("dashicons-arrow-up dashicons-sort").addClass("dashicons-arrow-down")},filter_sidebars:function(a){var b=jQuery("input.cs-filter").val().toLowerCase();csSidebars.right.find(".widgets-holder-wrap").each(function(){var a=jQuery(this);-1!==a.find(".sidebar-name h2").text().toLowerCase().indexOf(b)?a.show():a.hide()}),jQuery(window).trigger("cs-resize")},showEditor:function(b){function c(){i.$().removeClass("csb-has-more"),i.size(782,215)}function d(){i.$().addClass("csb-has-more"),i.size(782,545)}function e(){jQuery(this).prop("checked")?d():c()}function f(a,b,c){return i.loading(!1),!!a&&(b?(a.sidebar&&(a=a.sidebar),a.id&&i.$().find("#csb-id").val(a.id),a.name&&i.$().find("#csb-name").val(a.name),a.description&&i.$().find("#csb-description").val(a.description),a.before_title&&i.$().find("#csb-before-title").val(a.before_title),a.after_title&&i.$().find("#csb-after-title").val(a.after_title),a.before_widget&&i.$().find("#csb-before-widget").val(a.before_widget),a.after_widget&&i.$().find("#csb-after-widget").val(a.after_widget),void(a.button&&i.$().find(".btn-save").text(a.button))):(i.destroy(),csSidebars.showAjaxError(a),!1))}function g(b,c,d){var e,f={};i.loading(!1),i.destroy(),f.message=b.message,f.parent="#widgets-right",f.insert_after="#cs-title-options",f.id="editor",c?"update"===b.action?(e=csSidebars.find(b.data.id),csSidebars.updateSidebar(e,b.data)):"insert"===b.action&&(csSidebars.insertSidebar(b.data),a(".cs-wrap .custom-sidebars-add-new").detach()):f.type="err",wpmUi.message(f)}function h(){var a=i.$().find("form");return i.loading(!0),j.reset().data(a).ondone(g).load_json(),!1}var i=null,j=null;return b instanceof CsSidebar&&(b={id:b.getID(),title:csSidebarsData.title_edit.replace("[Sidebar]",b.name),button:csSidebarsData.btn_edit}),i=wpmUi.popup().modal(!0).title(b.title).onshow(c).content(csSidebars.edit_form),c(),f(b,!0,null),j=wpmUi.ajax(null,"cs-ajax"),b.id&&(i.loading(!0),j.reset().data({do:"get",sb:b.id}).ondone(f).load_json()),i.show(),i.$().find("#csb-name").focus(),i.$().on("keypress","#csb-name",function(b){13===b.keyCode&&0<a(this).val().length&&a("#csb-description").focus()}),i.$().on("keypress","#csb-description",function(a){13===a.keyCode&&i.$(".btn-save").click()}),i.$().on("click","#csb-more",e),i.$().on("click",".btn-save",h),i.$().on("click",".btn-cancel",i.destroy),!0},updateSidebar:function(a,b){return a.sb.find(".sidebar-name h2").text(b.name),a.sb.find(".sidebar-description").html('<p class="description"></p>').find(".description").text(b.description),csSidebars},insertSidebar:function(a){var b=jQuery('<div class="widgets-holder-wrap"></div>'),c=jQuery('<div class="widgets-sortables ui-sortable"></div>'),d=jQuery('<div class="sidebar-name"><div class="sidebar-name-arrow"><br></div><h2></h2></div>'),e=jQuery('<div class="sidebar-description"></div>'),f=csSidebars.right.find(".sidebars-column-1 > .inner:first");return c.attr("id",a.id),d.find("h2").text(a.name),e.html('<p class="description"></p>').find(".description").text(a.description),d.appendTo(c),e.appendTo(c),c.appendTo(b),b.prependTo(f),jQuery("#widgets-right .sidebar-name").unbind("click"),jQuery("#widgets-left .sidebar-name").unbind("click"),jQuery(document.body).unbind("click.widgets-toggle"),jQuery(".widgets-chooser").off("click.widgets-chooser").off("keyup.widgets-chooser"),jQuery("#available-widgets .widget .widget-title").off("click.widgets-chooser"),jQuery(".widgets-chooser-sidebars").empty(),window.wpWidgets.init(),csSidebars.initSidebars(),csSidebars},showExport:function(){function a(a){var b=jQuery(this).closest("form");return h.reset().data(b).load_http(),g.destroy(),a.preventDefault(),!1}function b(a,b,c){var d={};g.loading(!1),b?g.size(900,600).content(a.html):(d.message=a.message,d.parent=g.$().find(".wpmui-wnd-content"),d.insert_after=!1,d.id="export",d.class="wpmui-wnd-err",d.type="err",wpmUi.message(d))}function c(a){var c=jQuery(this).closest("form");return g.loading(!0),h.reset().data(c).ondone(b).load_json("cs-ajax"),a.preventDefault(),!1}function d(){var a=jQuery(this),b=a.prop("checked"),c=g.$().find(".column-widgets, .import-widgets");b?c.show():c.hide()}function e(){g.size(782,480),g.content(csSidebars.export_form)}function f(){var a=g.$().find(".frm-import");g.loading(!0),h.reset().data(a).load_http("_self")}var g=null,h=null;return g=wpmUi.popup().modal(!0).size(782,480).title(csSidebarsData.title_export).content(csSidebars.export_form).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("submit",".frm-export",a),g.$().on("submit",".frm-preview-import",c),g.$().on("change","#import-widgets",d),g.$().on("click",".btn-cancel",e),g.$().on("click",".btn-import",f),!0},showRemove:function(b){function c(a){a.find(".name").text(j)}function d(){g.loading(!1),g.destroy()}function e(a,b,c){var d={};g.loading(!1),g.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b?(csSidebars.right.find("#"+i).closest(".widgets-holder-wrap").remove(),csSidebars.remove(i),"delete"===a.action&&window.csSidebars.showGetStartedBox()):d.type="err",wpmUi.message(d)}function f(){g.loading(!0),h.reset().data({do:"delete",sb:i,_wpnonce:a("#_wp_nonce_cs_delete_sidebar").val()}).ondone(e).load_json()}var g=null,h=null,i=b.getID(),j=b.name;return g=wpmUi.popup().modal(!0).size(560,160).title(csSidebarsData.title_delete).content(csSidebars.delete_form).onshow(c).show(),h=wpmUi.ajax(null,"cs-ajax"),g.$().on("click",".btn-cancel",d),g.$().on("click",".btn-delete",f),!0},showLocations:function(a){function b(a,b,c){function d(a,b,c){var d=jQuery("<option></option>");d.attr("value",c).text(a.name),b.append(d)}function e(a,b,c,d){var e=d.closest(".cs-replaceable").filter("."+b),f=e.find('option[value="'+c+'"]'),g=e.find("optgroup.used"),h=e.find(".detail-toggle");a===j?(f.prop("selected",!0),!0!==h.prop("checked")&&(h.prop("checked",!0),e.addClass("open"),wpmUi.upgrade_multiselect(e))):(g.length||(g=jQuery('<optgroup class="used">').attr("label",e.data("lbl-used")).appendTo(e.find(".details select"))),f.detach().appendTo(g))}var g,h,i;if(f.loading(!1),!b)return f.destroy(),void csSidebars.showAjaxError(a);f.$().find(".sb-name").text(a.sidebar.name);var j=a.sidebar.id;f.$().find(".message.no-sidebars").hide();var k=0,l=f.$().find(".cs-replaceable");l.hide(),a.replaceable=wpmUi.obj(a.replaceable);for(var m in a.replaceable)a.replaceable.hasOwnProperty(m)&&(l.filter("."+a.replaceable[m]).show(),k++);0===k&&(f.$().find(".wpmui-box, .message, .button-primary").hide(),f.$().find(".message.no-sidebars").show().parent().addClass("notice notice-error").removeClass("hidden"));var n=f.$().find(".cs-datalist.cs-cat"),o=f.$().find(".cs-datalist.cs-arc-cat"),p=a.categories;o.empty(),n.empty();for(var q in p)d(p[q],o,q),d(p[q],n,q);for(var r in p){if(p[r].single)for(g in p[r].single)e(p[r].single[g],g,r,n);if(p[r].archive)for(g in p[r].archive)e(p[r].archive[g],g,r,o)}var s=f.$().find(".cs-datalist.cs-pt"),t=a.posttypes;s.empty();for(var u in t)h=jQuery("<option></option>"),i=t[u].name,h.attr("value",u).text(i),s.append(h);for(var v in t)if(t[v].single)for(g in t[v].single)e(t[v].single[g],g,v,s);var w=f.$().find(".cs-datalist.cs-arc"),x=a.archives;w.empty();for(var y in x)h=jQuery("<option></option>"),i=x[y].name,h.attr("value",y).text(i),w.append(h);for(var z in x)if(x[z].archive)for(g in x[z].archive)e(x[z].archive[g],g,z,w);var A=f.$().find(".cs-datalist.cs-arc-aut"),B=a.authors;A.empty();for(var C in B)h=jQuery("<option></option>"),i=B[C].name,h.attr("value",C).text(i),A.append(h);for(var D in B)if(B[D].archive)for(g in B[D].archive)e(B[D].archive[g],g,D,A)}function c(a){var b=jQuery(this),c=b.closest(".cs-replaceable"),d=c.find("select");b.prop("checked")?(c.addClass("open"),wpmUi.upgrade_multiselect(c),d.trigger("change.select2")):(c.removeClass("open"),d.val([]))}function d(a,b,c){var d={};f.loading(!1),f.destroy(),d.message=a.message,d.parent="#widgets-right",d.insert_after="#cs-title-options",d.id="editor",b||(d.type="err"),wpmUi.message(d)}function e(){f.loading(!0),g.reset().data(h).ondone(d).load_json()}var f=null,g=null,h=null,i=a.getID();return f=wpmUi.popup().modal(!0).size(782,560).title(csSidebarsData.title_location).content(csSidebars.location_form).show(),f.loading(!0),h=f.$().find(".frm-location"),h.find(".sb-id").val(i),g=wpmUi.ajax(null,"cs-ajax"),g.reset().data({do:"get-location",sb:i}).ondone(b).load_json(),f.$().on("click",".detail-toggle",c),f.$().on("click",".btn-save",e),f.$().on("click",".btn-cancel",f.destroy),!0},setReplaceable:function(a,b,c){function d(a,b,c){a instanceof Object&&"object"==typeof a.replaceable&&(csSidebarsData.replaceable=wpmUi.obj(a.replaceable),f.find(".widgets-sortables").each(function(){var a=!1,b=jQuery(this),c=b.attr("id"),d=csSidebars.find(c);for(var e in csSidebarsData.replaceable)if(csSidebarsData.replaceable.hasOwnProperty(e)&&csSidebarsData.replaceable[e]===c){a=!0;break}csSidebars.setReplaceable(d,a,!1)})),f.find(".cs-toolbar .chk-replaceable").prop("disabled",!1),f.find(".cs-toolbar .btn-replaceable").removeClass("wpmui-loading")}var e,f=csSidebars.right.find(".sidebars-column-2 .widgets-holder-wrap"),g=jQuery(a.sb).closest(".widgets-holder-wrap"),h=g.find(".cs-toolbar .chk-replaceable"),i=g.find(".replace-marker");g.find(".cs-toolbar .btn-replaceable");return void 0===b&&(b=h.prop("checked")),void 0===c&&(c=!0),h.data("active")!==b&&(h.data("active",b),h.prop("checked",b),b?(i.length||jQuery("<div></div>").appendTo(g).attr("data-label",csSidebarsData.lbl_replaceable).addClass("replace-marker"),g.addClass("replaceable")):(i.remove(),g.removeClass("replaceable")),c&&(f.find(".cs-toolbar .chk-replaceable").prop("disabled",!0),f.find(".cs-toolbar .btn-replaceable").addClass("wpmui-loading"),e=wpmUi.ajax(null,"cs-ajax"),e.reset().data({do:"replaceable",state:b,sb:a.getID()}).ondone(d).load_json()),!1)},find:function(a){return csSidebars.sidebars[a]},add:function(a,b){return csSidebars.sidebars[a]=new CsSidebar(a,b),csSidebars.sidebars[a]},remove:function(a){delete csSidebars.sidebars[a]},isCustomSidebar:function(a){return jQuery(a).attr("id").substr(0,csSidebars.sidebar_prefix.length)===csSidebars.sidebar_prefix},addIdToLabel:function(a,b){if(!0!==a.data("label-done")){var c=a.attr("for");a.attr("for",c+b),a.find(".has-label").attr("id",c+b),a.data("label-done",!0)}},getIdFromEditbar:function(a){return a.closest(".widgets-holder-wrap").find(".widgets-sortables:first").attr("id")},showGetStartedBox:function(){if(0===a(".sidebars-column-1 .inner .widgets-holder-wrap").length){var b=wp.template("custom-sidebars-new");a(".sidebars-column-1 .inner").before(b()),a(".custom-sidebars-add-new").on("click",function(){a("button.btn-create-sidebar").click()})}}},jQuery(function(a){a("#csfooter").hide(),a("#widgets-right").length>0&&csSidebars.init(),a(".defaultsContainer").hide(),a("#widgets-right .widgets-sortables").on("sort",function(b,c){a("#widgets-right").top;c.position.top=-a("#widgets-right").css("top")})}),jQuery(document).ready(function(a){window.setTimeout(function(){window.csSidebars.showGetStartedBox()},1e3)})}(jQuery),jQuery.fn.sortElements=function(){var a=[].sort;return function(b,c){c=c||function(){return this};var d=this.map(function(){var a=c.call(this),b=a.parentNode,d=b.insertBefore(document.createTextNode(""),a.nextSibling);return function(){if(b===this)throw new Error("You can't sort elements if any one is a descendant of another.");b.insertBefore(this,d),b.removeChild(d)}});return a.call(this,b).each(function(a){d[a].call(c.call(this))})}}(),function(a){jQuery(document).ready(function(a){a("#screen-options-wrap .cs-roles input[type=checkbox]").on("change",function(){var b={action:"custom_sidebars_metabox_roles",_wpnonce:a("#custom_sidebars_metabox_roles").val(),fields:{}};a("#screen-options-wrap .cs-roles input[type=checkbox]").each(function(){b.fields[a(this).val()]=this.checked}),a.post(ajaxurl,b)})})}(jQuery);
lang/custom-sidebars.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Custom Sidebars Pro PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/customsidebars\n"
7
- "POT-Creation-Date: 2017-06-29 16:35:36+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -56,99 +56,104 @@ msgstr ""
56
  msgid "get Upfront free"
57
  msgstr ""
58
 
59
- #: inc/class-custom-sidebars-cloning.php:202
60
  msgid "Clone"
61
  msgstr ""
62
 
63
- #: inc/class-custom-sidebars-editor.php:127
64
  #: inc/class-custom-sidebars-export.php:97
65
  msgid "You do not have permission for this"
66
  msgstr ""
67
 
68
- #: inc/class-custom-sidebars-editor.php:198
69
- #: inc/class-custom-sidebars-editor.php:324
70
  msgid "You have no permission to do this operation."
71
  msgstr ""
72
 
73
- #: inc/class-custom-sidebars-editor.php:214
74
  msgid "Sidebar-name cannot be empty"
75
  msgstr ""
76
 
77
- #: inc/class-custom-sidebars-editor.php:238
78
- #: inc/class-custom-sidebars-editor.php:333
79
  msgid "The sidebar does not exist"
80
  msgstr ""
81
 
82
- #: inc/class-custom-sidebars-editor.php:269
83
  msgid "Created new sidebar <strong>%1$s</strong>"
84
  msgstr ""
85
 
86
- #: inc/class-custom-sidebars-editor.php:277
87
  msgid "Updated sidebar <strong>%1$s</strong>"
88
  msgstr ""
89
 
90
- #: inc/class-custom-sidebars-editor.php:288
91
- #: inc/class-custom-sidebars-editor.php:353
92
  msgid "The sidebar was not found"
93
  msgstr ""
94
 
95
- #: inc/class-custom-sidebars-editor.php:342
96
  msgid "Deleted sidebar <strong>%1$s</strong>"
97
  msgstr ""
98
 
99
- #: inc/class-custom-sidebars-editor.php:415
 
100
  msgid "Front Page"
101
  msgstr ""
102
 
103
- #: inc/class-custom-sidebars-editor.php:416
104
  msgid "Search Results"
105
  msgstr ""
106
 
107
- #: inc/class-custom-sidebars-editor.php:417
108
- #: inc/class-custom-sidebars-visibility.php:158
109
  msgid "Not found (404)"
110
  msgstr ""
111
 
112
- #: inc/class-custom-sidebars-editor.php:418
113
  msgid "Any Author Archive"
114
  msgstr ""
115
 
116
- #: inc/class-custom-sidebars-editor.php:419
117
  msgid "Date Archives"
118
  msgstr ""
119
 
120
- #: inc/class-custom-sidebars-editor.php:437
121
- #: inc/class-custom-sidebars-editor.php:440
122
- #: inc/class-custom-sidebars-editor.php:446
123
- #: inc/class-custom-sidebars-editor.php:448
124
- #: inc/class-custom-sidebars-editor.php:532
125
- #: inc/class-custom-sidebars-editor.php:534
126
- #: inc/class-custom-sidebars-editor.php:553
127
  msgid "%s Archives"
128
  msgstr ""
129
 
130
- #: inc/class-custom-sidebars-editor.php:495
131
- #: inc/class-custom-sidebars-visibility.php:153
132
  msgid "Post Index"
133
  msgstr ""
134
 
135
- #: inc/class-custom-sidebars-editor.php:499
136
  msgid "%1$s Archives"
137
  msgstr ""
138
 
139
- #: inc/class-custom-sidebars-editor.php:754
140
  msgid "Updated sidebar <strong>%1$s</strong> settings."
141
  msgstr ""
142
 
143
- #: inc/class-custom-sidebars-editor.php:790 views/widgets.php:17
144
  msgid "Sidebars"
145
  msgstr ""
146
 
147
- #: inc/class-custom-sidebars-editor.php:1049 views/bulk-edit.php:23
148
  #: views/import.php:123 views/widgets.php:47
149
  msgid "Custom Sidebars"
150
  msgstr ""
151
 
 
 
 
 
152
  #: inc/class-custom-sidebars-explain.php:225
153
  msgid "Sidebar Debug"
154
  msgstr ""
@@ -194,139 +199,135 @@ msgstr ""
194
  msgid "Imported %d widget(s)!"
195
  msgstr ""
196
 
197
- #: inc/class-custom-sidebars-visibility.php:152
198
- msgid "aFront Page"
199
- msgstr ""
200
-
201
- #: inc/class-custom-sidebars-visibility.php:154
202
  msgid "Single page"
203
  msgstr ""
204
 
205
- #: inc/class-custom-sidebars-visibility.php:156
206
  msgid "Archives"
207
  msgstr ""
208
 
209
- #: inc/class-custom-sidebars-visibility.php:157
210
  msgid "Search results"
211
  msgstr ""
212
 
213
- #: inc/class-custom-sidebars-visibility.php:159 views/widgets-export.php:42
214
  msgid "Preview"
215
  msgstr ""
216
 
217
- #: inc/class-custom-sidebars-visibility.php:160
218
  msgid "Archive: Day"
219
  msgstr ""
220
 
221
- #: inc/class-custom-sidebars-visibility.php:161
222
  msgid "Archive: Month"
223
  msgstr ""
224
 
225
- #: inc/class-custom-sidebars-visibility.php:162
226
  msgid "Archive: Year"
227
  msgstr ""
228
 
229
- #: inc/class-custom-sidebars-visibility.php:196
230
  msgid "Visibility"
231
  msgstr ""
232
 
233
- #: inc/class-custom-sidebars-visibility.php:205
234
  msgid "<b>Show</b> widget if:"
235
  msgstr ""
236
 
237
- #: inc/class-custom-sidebars-visibility.php:206
238
  msgid "<b>Hide</b> widget if:"
239
  msgstr ""
240
 
241
- #: inc/class-custom-sidebars-visibility.php:210
242
  msgid "Filters"
243
  msgstr ""
244
 
245
- #: inc/class-custom-sidebars-visibility.php:214
246
  msgid "Date"
247
  msgstr ""
248
 
249
- #: inc/class-custom-sidebars-visibility.php:219
250
  msgid "Guests"
251
  msgstr ""
252
 
253
- #: inc/class-custom-sidebars-visibility.php:224
254
  msgid "Roles"
255
  msgstr ""
256
 
257
- #: inc/class-custom-sidebars-visibility.php:229
258
  msgid "Membership"
259
  msgstr ""
260
 
261
- #: inc/class-custom-sidebars-visibility.php:235
262
  msgid "Membership2"
263
  msgstr ""
264
 
265
- #: inc/class-custom-sidebars-visibility.php:241 views/import.php:302
266
  msgid "Special pages"
267
  msgstr ""
268
 
269
- #: inc/class-custom-sidebars-visibility.php:246
270
  msgid "For posttype"
271
  msgstr ""
272
 
273
- #: inc/class-custom-sidebars-visibility.php:248
274
  msgid "Taxonomy"
275
  msgstr ""
276
 
277
- #: inc/class-custom-sidebars-visibility.php:265
278
  msgid "Always"
279
  msgstr ""
280
 
281
- #: inc/class-custom-sidebars-visibility.php:290
282
- #: inc/class-custom-sidebars-visibility.php:295
283
- #: inc/class-custom-sidebars-visibility.php:304
284
- #: inc/class-custom-sidebars-visibility.php:323
285
- #: inc/class-custom-sidebars-visibility.php:343
286
- #: inc/class-custom-sidebars-visibility.php:362
287
- #: inc/class-custom-sidebars-visibility.php:381
288
- #: inc/class-custom-sidebars-visibility.php:465
289
  msgid "AND"
290
  msgstr ""
291
 
292
- #: inc/class-custom-sidebars-visibility.php:291
293
  msgid "User is not logged-in (Guest)"
294
  msgstr ""
295
 
296
- #: inc/class-custom-sidebars-visibility.php:296
297
  msgid "User is logged-in (Member)"
298
  msgstr ""
299
 
300
- #: inc/class-custom-sidebars-visibility.php:305
301
  msgid "User has role"
302
  msgstr ""
303
 
304
- #: inc/class-custom-sidebars-visibility.php:324
305
  msgid "User has Membership Level"
306
  msgstr ""
307
 
308
- #: inc/class-custom-sidebars-visibility.php:332
309
- #: inc/class-custom-sidebars-visibility.php:352
310
  msgid "(inactive)"
311
  msgstr ""
312
 
313
- #: inc/class-custom-sidebars-visibility.php:344
314
  msgid "User has Membership"
315
  msgstr ""
316
 
317
- #: inc/class-custom-sidebars-visibility.php:363
318
  msgid "On these special pages"
319
  msgstr ""
320
 
321
- #: inc/class-custom-sidebars-visibility.php:382
322
  msgid "On any page of these types"
323
  msgstr ""
324
 
325
- #: inc/class-custom-sidebars-visibility.php:400
326
  msgid "Only for specific %s"
327
  msgstr ""
328
 
329
- #: inc/class-custom-sidebars-visibility.php:401
330
  msgid "Only these %s:"
331
  msgstr ""
332
 
@@ -337,15 +338,15 @@ msgid ""
337
  "\t\t\t\t\t\tto disable accessibility mode and use the %1$s plugin!"
338
  msgstr ""
339
 
340
- #: inc/class-custom-sidebars.php:943 views/import.php:140
341
  msgid "Widgets"
342
  msgstr ""
343
 
344
- #: inc/class-custom-sidebars.php:953
345
  msgid "Support"
346
  msgstr ""
347
 
348
- #: inc/class-custom-sidebars.php:970
349
  msgid "Create a custom sidebar to get started."
350
  msgstr ""
351
 
@@ -397,11 +398,11 @@ msgstr ""
397
  msgid "Also import all widgets of the selected sidebars."
398
  msgstr ""
399
 
400
- #: views/import.php:137 views/widgets-editor.php:16
401
  msgid "Name"
402
  msgstr ""
403
 
404
- #: views/import.php:138 views/widgets-editor.php:21
405
  msgid "Description"
406
  msgstr ""
407
 
@@ -479,7 +480,7 @@ msgid ""
479
  "class=\"name\"></strong>."
480
  msgstr ""
481
 
482
- #: views/widgets-delete.php:16 views/widgets-editor.php:64
483
  #: views/widgets-location.php:189
484
  msgid "Cancel"
485
  msgstr ""
@@ -488,43 +489,43 @@ msgstr ""
488
  msgid "Yes, delete it"
489
  msgstr ""
490
 
491
- #: views/widgets-editor.php:17
492
  msgid "Sidebar name here..."
493
  msgstr ""
494
 
495
- #: views/widgets-editor.php:18
496
  msgid "The name must be unique."
497
  msgstr ""
498
 
499
- #: views/widgets-editor.php:22
500
  msgid "Sidebar description here..."
501
  msgstr ""
502
 
503
- #: views/widgets-editor.php:28
504
  msgid "Caution:"
505
  msgstr ""
506
 
507
- #: views/widgets-editor.php:40
508
  msgid "Before Title"
509
  msgstr ""
510
 
511
- #: views/widgets-editor.php:44
512
  msgid "After Title"
513
  msgstr ""
514
 
515
- #: views/widgets-editor.php:50
516
  msgid "Before Widget"
517
  msgstr ""
518
 
519
- #: views/widgets-editor.php:54
520
  msgid "After Widget"
521
  msgstr ""
522
 
523
- #: views/widgets-editor.php:61
524
  msgid "Advanced - Edit custom wrapper code"
525
  msgstr ""
526
 
527
- #: views/widgets-editor.php:65 views/widgets.php:43
528
  msgid "Create Sidebar"
529
  msgstr ""
530
 
4
  msgstr ""
5
  "Project-Id-Version: Custom Sidebars Pro PLUGIN_VERSION\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/customsidebars\n"
7
+ "POT-Creation-Date: 2017-07-03 08:18:19+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
56
  msgid "get Upfront free"
57
  msgstr ""
58
 
59
+ #: inc/class-custom-sidebars-cloning.php:206
60
  msgid "Clone"
61
  msgstr ""
62
 
63
+ #: inc/class-custom-sidebars-editor.php:146
64
  #: inc/class-custom-sidebars-export.php:97
65
  msgid "You do not have permission for this"
66
  msgstr ""
67
 
68
+ #: inc/class-custom-sidebars-editor.php:217
69
+ #: inc/class-custom-sidebars-editor.php:351
70
  msgid "You have no permission to do this operation."
71
  msgstr ""
72
 
73
+ #: inc/class-custom-sidebars-editor.php:238
74
  msgid "Sidebar-name cannot be empty"
75
  msgstr ""
76
 
77
+ #: inc/class-custom-sidebars-editor.php:262
78
+ #: inc/class-custom-sidebars-editor.php:360
79
  msgid "The sidebar does not exist"
80
  msgstr ""
81
 
82
+ #: inc/class-custom-sidebars-editor.php:293
83
  msgid "Created new sidebar <strong>%1$s</strong>"
84
  msgstr ""
85
 
86
+ #: inc/class-custom-sidebars-editor.php:301
87
  msgid "Updated sidebar <strong>%1$s</strong>"
88
  msgstr ""
89
 
90
+ #: inc/class-custom-sidebars-editor.php:312
91
+ #: inc/class-custom-sidebars-editor.php:380
92
  msgid "The sidebar was not found"
93
  msgstr ""
94
 
95
+ #: inc/class-custom-sidebars-editor.php:369
96
  msgid "Deleted sidebar <strong>%1$s</strong>"
97
  msgstr ""
98
 
99
+ #: inc/class-custom-sidebars-editor.php:442
100
+ #: inc/class-custom-sidebars-visibility.php:156
101
  msgid "Front Page"
102
  msgstr ""
103
 
104
+ #: inc/class-custom-sidebars-editor.php:443
105
  msgid "Search Results"
106
  msgstr ""
107
 
108
+ #: inc/class-custom-sidebars-editor.php:444
109
+ #: inc/class-custom-sidebars-visibility.php:162
110
  msgid "Not found (404)"
111
  msgstr ""
112
 
113
+ #: inc/class-custom-sidebars-editor.php:445
114
  msgid "Any Author Archive"
115
  msgstr ""
116
 
117
+ #: inc/class-custom-sidebars-editor.php:446
118
  msgid "Date Archives"
119
  msgstr ""
120
 
121
+ #: inc/class-custom-sidebars-editor.php:464
122
+ #: inc/class-custom-sidebars-editor.php:467
123
+ #: inc/class-custom-sidebars-editor.php:474
124
+ #: inc/class-custom-sidebars-editor.php:476
125
+ #: inc/class-custom-sidebars-editor.php:560
126
+ #: inc/class-custom-sidebars-editor.php:562
127
+ #: inc/class-custom-sidebars-editor.php:581
128
  msgid "%s Archives"
129
  msgstr ""
130
 
131
+ #: inc/class-custom-sidebars-editor.php:523
132
+ #: inc/class-custom-sidebars-visibility.php:157
133
  msgid "Post Index"
134
  msgstr ""
135
 
136
+ #: inc/class-custom-sidebars-editor.php:527
137
  msgid "%1$s Archives"
138
  msgstr ""
139
 
140
+ #: inc/class-custom-sidebars-editor.php:785
141
  msgid "Updated sidebar <strong>%1$s</strong> settings."
142
  msgstr ""
143
 
144
+ #: inc/class-custom-sidebars-editor.php:826 views/widgets.php:17
145
  msgid "Sidebars"
146
  msgstr ""
147
 
148
+ #: inc/class-custom-sidebars-editor.php:1099 views/bulk-edit.php:23
149
  #: views/import.php:123 views/widgets.php:47
150
  msgid "Custom Sidebars"
151
  msgstr ""
152
 
153
+ #: inc/class-custom-sidebars-editor.php:1299
154
+ msgid "Custom sidebars configuration is allowed for:"
155
+ msgstr ""
156
+
157
  #: inc/class-custom-sidebars-explain.php:225
158
  msgid "Sidebar Debug"
159
  msgstr ""
199
  msgid "Imported %d widget(s)!"
200
  msgstr ""
201
 
202
+ #: inc/class-custom-sidebars-visibility.php:158
 
 
 
 
203
  msgid "Single page"
204
  msgstr ""
205
 
206
+ #: inc/class-custom-sidebars-visibility.php:160
207
  msgid "Archives"
208
  msgstr ""
209
 
210
+ #: inc/class-custom-sidebars-visibility.php:161
211
  msgid "Search results"
212
  msgstr ""
213
 
214
+ #: inc/class-custom-sidebars-visibility.php:163 views/widgets-export.php:42
215
  msgid "Preview"
216
  msgstr ""
217
 
218
+ #: inc/class-custom-sidebars-visibility.php:164
219
  msgid "Archive: Day"
220
  msgstr ""
221
 
222
+ #: inc/class-custom-sidebars-visibility.php:165
223
  msgid "Archive: Month"
224
  msgstr ""
225
 
226
+ #: inc/class-custom-sidebars-visibility.php:166
227
  msgid "Archive: Year"
228
  msgstr ""
229
 
230
+ #: inc/class-custom-sidebars-visibility.php:200
231
  msgid "Visibility"
232
  msgstr ""
233
 
234
+ #: inc/class-custom-sidebars-visibility.php:209
235
  msgid "<b>Show</b> widget if:"
236
  msgstr ""
237
 
238
+ #: inc/class-custom-sidebars-visibility.php:210
239
  msgid "<b>Hide</b> widget if:"
240
  msgstr ""
241
 
242
+ #: inc/class-custom-sidebars-visibility.php:214
243
  msgid "Filters"
244
  msgstr ""
245
 
246
+ #: inc/class-custom-sidebars-visibility.php:218
247
  msgid "Date"
248
  msgstr ""
249
 
250
+ #: inc/class-custom-sidebars-visibility.php:223
251
  msgid "Guests"
252
  msgstr ""
253
 
254
+ #: inc/class-custom-sidebars-visibility.php:228
255
  msgid "Roles"
256
  msgstr ""
257
 
258
+ #: inc/class-custom-sidebars-visibility.php:233
259
  msgid "Membership"
260
  msgstr ""
261
 
262
+ #: inc/class-custom-sidebars-visibility.php:239
263
  msgid "Membership2"
264
  msgstr ""
265
 
266
+ #: inc/class-custom-sidebars-visibility.php:245 views/import.php:302
267
  msgid "Special pages"
268
  msgstr ""
269
 
270
+ #: inc/class-custom-sidebars-visibility.php:250
271
  msgid "For posttype"
272
  msgstr ""
273
 
274
+ #: inc/class-custom-sidebars-visibility.php:252
275
  msgid "Taxonomy"
276
  msgstr ""
277
 
278
+ #: inc/class-custom-sidebars-visibility.php:269
279
  msgid "Always"
280
  msgstr ""
281
 
282
+ #: inc/class-custom-sidebars-visibility.php:294
283
+ #: inc/class-custom-sidebars-visibility.php:299
284
+ #: inc/class-custom-sidebars-visibility.php:308
285
+ #: inc/class-custom-sidebars-visibility.php:327
286
+ #: inc/class-custom-sidebars-visibility.php:347
287
+ #: inc/class-custom-sidebars-visibility.php:366
288
+ #: inc/class-custom-sidebars-visibility.php:385
289
+ #: inc/class-custom-sidebars-visibility.php:469
290
  msgid "AND"
291
  msgstr ""
292
 
293
+ #: inc/class-custom-sidebars-visibility.php:295
294
  msgid "User is not logged-in (Guest)"
295
  msgstr ""
296
 
297
+ #: inc/class-custom-sidebars-visibility.php:300
298
  msgid "User is logged-in (Member)"
299
  msgstr ""
300
 
301
+ #: inc/class-custom-sidebars-visibility.php:309
302
  msgid "User has role"
303
  msgstr ""
304
 
305
+ #: inc/class-custom-sidebars-visibility.php:328
306
  msgid "User has Membership Level"
307
  msgstr ""
308
 
309
+ #: inc/class-custom-sidebars-visibility.php:336
310
+ #: inc/class-custom-sidebars-visibility.php:356
311
  msgid "(inactive)"
312
  msgstr ""
313
 
314
+ #: inc/class-custom-sidebars-visibility.php:348
315
  msgid "User has Membership"
316
  msgstr ""
317
 
318
+ #: inc/class-custom-sidebars-visibility.php:367
319
  msgid "On these special pages"
320
  msgstr ""
321
 
322
+ #: inc/class-custom-sidebars-visibility.php:386
323
  msgid "On any page of these types"
324
  msgstr ""
325
 
326
+ #: inc/class-custom-sidebars-visibility.php:404
327
  msgid "Only for specific %s"
328
  msgstr ""
329
 
330
+ #: inc/class-custom-sidebars-visibility.php:405
331
  msgid "Only these %s:"
332
  msgstr ""
333
 
338
  "\t\t\t\t\t\tto disable accessibility mode and use the %1$s plugin!"
339
  msgstr ""
340
 
341
+ #: inc/class-custom-sidebars.php:950 views/import.php:140
342
  msgid "Widgets"
343
  msgstr ""
344
 
345
+ #: inc/class-custom-sidebars.php:960
346
  msgid "Support"
347
  msgstr ""
348
 
349
+ #: inc/class-custom-sidebars.php:977
350
  msgid "Create a custom sidebar to get started."
351
  msgstr ""
352
 
398
  msgid "Also import all widgets of the selected sidebars."
399
  msgstr ""
400
 
401
+ #: views/import.php:137 views/widgets-editor.php:15
402
  msgid "Name"
403
  msgstr ""
404
 
405
+ #: views/import.php:138 views/widgets-editor.php:20
406
  msgid "Description"
407
  msgstr ""
408
 
480
  "class=\"name\"></strong>."
481
  msgstr ""
482
 
483
+ #: views/widgets-delete.php:16 views/widgets-editor.php:63
484
  #: views/widgets-location.php:189
485
  msgid "Cancel"
486
  msgstr ""
489
  msgid "Yes, delete it"
490
  msgstr ""
491
 
492
+ #: views/widgets-editor.php:16
493
  msgid "Sidebar name here..."
494
  msgstr ""
495
 
496
+ #: views/widgets-editor.php:17
497
  msgid "The name must be unique."
498
  msgstr ""
499
 
500
+ #: views/widgets-editor.php:21
501
  msgid "Sidebar description here..."
502
  msgstr ""
503
 
504
+ #: views/widgets-editor.php:27
505
  msgid "Caution:"
506
  msgstr ""
507
 
508
+ #: views/widgets-editor.php:39
509
  msgid "Before Title"
510
  msgstr ""
511
 
512
+ #: views/widgets-editor.php:43
513
  msgid "After Title"
514
  msgstr ""
515
 
516
+ #: views/widgets-editor.php:49
517
  msgid "Before Widget"
518
  msgstr ""
519
 
520
+ #: views/widgets-editor.php:53
521
  msgid "After Widget"
522
  msgstr ""
523
 
524
+ #: views/widgets-editor.php:60
525
  msgid "Advanced - Edit custom wrapper code"
526
  msgstr ""
527
 
528
+ #: views/widgets-editor.php:64 views/widgets.php:43
529
  msgid "Create Sidebar"
530
  msgstr ""
531
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WPMUDEV, marquex, WPMUDEV-Support2, WPMUDEV-Support1, WPMUDEV-Supp
3
  Tags: sidebar, widget, footer, custom, flexible layout, dynamic widgets, manage sidebars, replace widgets, custom widget area
4
  Requires at least: 3.6
5
  Tested up to: 4.8
6
- Stable tag: 3.0.8.1
7
 
8
  Flexible sidebars for custom widget configurations on every page, post and custom post type on your site.
9
 
@@ -59,9 +59,10 @@ Get <a href="https://premium.wpmudev.org/project/custom-sidebars-pro/">Custom Si
59
 
60
  == Screenshots ==
61
 
62
- 1. Set custom sidebars for individual posts and pages or by category, post-type, or archive.
63
- 2. Create new sidebars without confusing settings.
64
- 3. Integrates with WordPress core Widgets menu.
 
65
 
66
  == Installation ==
67
 
@@ -120,6 +121,12 @@ If you are running a earlier version of WordPress download Custom Sidebars 0.8.2
120
 
121
  == Changelog ==
122
 
 
 
 
 
 
 
123
  = 3.0.8.1 =
124
  * Fixed CSRF vulnerability. Props for [qasuar](https://wordpress.org/support/users/qasuar/)
125
 
3
  Tags: sidebar, widget, footer, custom, flexible layout, dynamic widgets, manage sidebars, replace widgets, custom widget area
4
  Requires at least: 3.6
5
  Tested up to: 4.8
6
+ Stable tag: 3.0.9
7
 
8
  Flexible sidebars for custom widget configurations on every page, post and custom post type on your site.
9
 
59
 
60
  == Screenshots ==
61
 
62
+ 1. Set custom configuration on sidebar from native WordPress widget option.
63
+ 2. Set custom sidebars for individual posts and pages or by category, post-type, or archive.
64
+ 3. Create new sidebars without confusing settings.
65
+ 4. Integrates with WordPress core Widgets menu.
66
 
67
  == Installation ==
68
 
121
 
122
  == Changelog ==
123
 
124
+ = 3.0.9 =
125
+ - Added ability to turn off "Custom Sidebars" for certain roles.
126
+ - Fixed a problem with a category, category archive, and post in category replacement.
127
+ - Fixed a problem with removed "Category Archive" from "For Archives" options.
128
+ - Fixed build in taxonomies problem on "Sidebar Location" edit window.
129
+
130
  = 3.0.8.1 =
131
  * Fixed CSRF vulnerability. Props for [qasuar](https://wordpress.org/support/users/qasuar/)
132
 
views/widgets-delete.php CHANGED
@@ -15,6 +15,6 @@
15
  <div class="buttons">
16
  <button type="button" class="button-link btn-cancel"><?php _e( 'Cancel', 'custom-sidebars' ); ?></button>
17
  <button type="button" class="button-primary btn-delete"><?php _e( 'Yes, delete it', 'custom-sidebars' ); ?></button>
18
- <?php wp_nonce_field( 'custom-sidebars-delete-sidebar', '_wp_nonce_cs_delete_sidebar' ); ?>
19
  </div>
20
  </div>
15
  <div class="buttons">
16
  <button type="button" class="button-link btn-cancel"><?php _e( 'Cancel', 'custom-sidebars' ); ?></button>
17
  <button type="button" class="button-primary btn-delete"><?php _e( 'Yes, delete it', 'custom-sidebars' ); ?></button>
18
+ <?php wp_nonce_field( 'custom-sidebars-delete-sidebar', '_wp_nonce_cs_delete_sidebar' ); ?>
19
  </div>
20
  </div>
views/widgets-editor.php CHANGED
@@ -9,8 +9,7 @@
9
  <form class="wpmui-form">
10
  <input type="hidden" name="do" value="save" />
11
  <input type="hidden" name="sb" id="csb-id" value="" />
12
- <?php wp_nonce_field( 'custom-sidebars-edit-sidebar' ); ?>
13
-
14
  <div class="wpmui-grid-8 no-pad-top">
15
  <div class="col-3">
16
  <label for="csb-name"><?php _e( 'Name', 'custom-sidebars' ); ?></label>
9
  <form class="wpmui-form">
10
  <input type="hidden" name="do" value="save" />
11
  <input type="hidden" name="sb" id="csb-id" value="" />
12
+ <?php wp_nonce_field( 'custom-sidebars-edit-sidebar' ); ?>
 
13
  <div class="wpmui-grid-8 no-pad-top">
14
  <div class="col-3">
15
  <label for="csb-name"><?php _e( 'Name', 'custom-sidebars' ); ?></label>