Genesis Simple Sidebars - Version 2.0.0

Version Description

  • Compatibility with Genesis 2.0
  • Standards
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Genesis Simple Sidebars
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.0.0 to 2.0.0

includes/admin.php CHANGED
@@ -34,14 +34,14 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic {
34
  )
35
  );
36
 
37
- /** Empty, as we'll be building the page manually */
38
  $page_ops = array();
39
 
40
  $settings_field = SS_SETTINGS_FIELD;
41
 
42
  $this->create( $page_id, $menu_ops, $page_ops, $settings_field );
43
 
44
- /** Simpe Sidebar actions (create, edit, or delete) */
45
  add_action( 'admin_init', array( $this, 'actions' ) );
46
 
47
  }
@@ -123,7 +123,7 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic {
123
  * Action handler.
124
  *
125
  * Depending on what action was intended by the user, this method calls the appropriate action method.
126
- *
127
  * @since 1.0.0
128
  *
129
  */
@@ -201,10 +201,10 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic {
201
  exit;
202
  }
203
 
204
- // nonce verification
205
  check_admin_referer( 'simple-sidebars-action_create-sidebar' );
206
 
207
- // WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user
208
  if ( is_numeric( $args['id'] ) )
209
  $args['id'] = sanitize_title_with_dashes( $args['name'] );
210
 
@@ -242,10 +242,10 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic {
242
  exit;
243
  }
244
 
245
- // nonce verification
246
  check_admin_referer( 'simple-sidebars-action_edit-sidebar' );
247
 
248
- // WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user
249
  if ( is_numeric( $args['id'] ) )
250
  $args['id'] = sanitize_title_with_dashes( $args['name'] );
251
 
@@ -283,7 +283,7 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic {
283
  exit;
284
  }
285
 
286
- // nonce verification
287
  check_admin_referer( 'simple-sidebars-action_delete-sidebar' );
288
 
289
  $_sidebars = (array) get_option( SS_SETTINGS_FIELD );
@@ -346,4 +346,4 @@ function simplesidebars_settings_menu() {
346
 
347
  new Genesis_Simple_Sidebars_Admin;
348
 
349
- }
34
  )
35
  );
36
 
37
+ //* Empty, as we'll be building the page manually
38
  $page_ops = array();
39
 
40
  $settings_field = SS_SETTINGS_FIELD;
41
 
42
  $this->create( $page_id, $menu_ops, $page_ops, $settings_field );
43
 
44
+ //* Simpe Sidebar actions (create, edit, or delete)
45
  add_action( 'admin_init', array( $this, 'actions' ) );
46
 
47
  }
123
  * Action handler.
124
  *
125
  * Depending on what action was intended by the user, this method calls the appropriate action method.
126
+ *
127
  * @since 1.0.0
128
  *
129
  */
201
  exit;
202
  }
203
 
204
+ //* nonce verification
205
  check_admin_referer( 'simple-sidebars-action_create-sidebar' );
206
 
207
+ //* WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user
208
  if ( is_numeric( $args['id'] ) )
209
  $args['id'] = sanitize_title_with_dashes( $args['name'] );
210
 
242
  exit;
243
  }
244
 
245
+ //* nonce verification
246
  check_admin_referer( 'simple-sidebars-action_edit-sidebar' );
247
 
248
+ //* WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user
249
  if ( is_numeric( $args['id'] ) )
250
  $args['id'] = sanitize_title_with_dashes( $args['name'] );
251
 
283
  exit;
284
  }
285
 
286
+ //* nonce verification
287
  check_admin_referer( 'simple-sidebars-action_delete-sidebar' );
288
 
289
  $_sidebars = (array) get_option( SS_SETTINGS_FIELD );
346
 
347
  new Genesis_Simple_Sidebars_Admin;
348
 
349
+ }
includes/inpost.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
 
2
  /**
3
  * This bit of code registers the meta box on posts/pages,
4
  * so that users can choose what sidebar to use.
5
  */
6
- add_action('admin_menu', 'ss_add_inpost_metabox');
7
  function ss_add_inpost_metabox() {
8
 
9
- foreach ( (array)get_post_types( array( 'public' => true ) ) as $type ) {
10
 
11
  if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) {
12
- add_meta_box('ss_inpost_metabox', __('Sidebar Selection', 'ss'), 'ss_inpost_metabox', $type, 'side', 'low');
13
  }
14
 
15
  }
@@ -22,31 +22,31 @@ function ss_inpost_metabox() {
22
 
23
  ?>
24
 
25
- <input type="hidden" name="ss_inpost_nonce" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
26
 
27
  <p>
28
- <label class="howto" for="_ss_sidebar"><span><?php _e('Primary Sidebar', 'ss'); ?><span></label>
29
  <select name="_ss_sidebar" id="_ss_sidebar" style="width: 99%">
30
- <option value=""><?php _e('Default', 'ss'); ?></option>
31
  <?php
32
- foreach ( (array)$_sidebars as $id => $info ) {
33
- printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, genesis_get_custom_field('_ss_sidebar'), false), esc_html( $info['name'] ) );
34
  }
35
  ?>
36
  </select>
37
  </p>
38
  <?php
39
- // don't show the option if there are no 3 column layouts registered
40
  if ( ! ss_has_3_column_layouts() )
41
  return;
42
  ?>
43
  <p>
44
- <label class="howto" for="_ss_sidebar_alt"><span><?php _e('Secondary Sidebar', 'ss'); ?><span></label>
45
  <select name="_ss_sidebar_alt" id="_ss_sidebar_alt" style="width: 99%">
46
- <option value=""><?php _e('Default', 'ss'); ?></option>
47
  <?php
48
- foreach ( (array)$_sidebars as $id => $info ) {
49
- printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, genesis_get_custom_field('_ss_sidebar_alt'), false), esc_html( $info['name'] ) );
50
  }
51
  ?>
52
  </select>
@@ -55,43 +55,43 @@ function ss_inpost_metabox() {
55
  <?php
56
  }
57
 
 
58
  /**
59
  * This bit of code saves the sidebars chosen as post meta.
60
  */
61
- add_action('save_post', 'ss_inpost_metabox_save', 1, 2);
62
  function ss_inpost_metabox_save( $post_id, $post ) {
63
 
64
- // verify the nonce
65
  if ( !isset($_POST['ss_inpost_nonce']) || !wp_verify_nonce( $_POST['ss_inpost_nonce'], plugin_basename(__FILE__) ) )
66
  return $post->ID;
67
 
68
- // don't try to save the data under autosave, ajax, or future post.
69
  if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;
70
  if ( defined('DOING_AJAX') && DOING_AJAX ) return;
71
  if ( defined('DOING_CRON') && DOING_CRON ) return;
72
 
73
- // is the user allowed to edit the post or page?
74
- if ( ( 'page' == $_POST['post_type'] && !current_user_can('edit_page', $post->ID) ) || !current_user_can('edit_post', $post->ID ) )
75
  return $post->ID;
76
 
77
  $_sidebars = array(
78
- '_ss_sidebar' => $_POST['_ss_sidebar'],
79
- '_ss_sidebar_alt' => $_POST['_ss_sidebar_alt']
80
  );
81
 
82
- // store the custom fields
83
  foreach ( $_sidebars as $key => $value ) {
84
 
85
- if ( $post->post_type == 'revision' ) return; // don't try to store data during revision save
 
 
86
 
87
  if ( $value ) {
88
- // save/update
89
  update_post_meta($post->ID, $key, $value);
90
  } else {
91
- // delete if blank
92
  delete_post_meta($post->ID, $key);
93
  }
94
 
95
  }
96
 
97
- }
1
  <?php
2
+ add_action('admin_menu', 'ss_add_inpost_metabox');
3
  /**
4
  * This bit of code registers the meta box on posts/pages,
5
  * so that users can choose what sidebar to use.
6
  */
 
7
  function ss_add_inpost_metabox() {
8
 
9
+ foreach ( (array) get_post_types( array( 'public' => true ) ) as $type ) {
10
 
11
  if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) {
12
+ add_meta_box( 'ss_inpost_metabox', __( 'Sidebar Selection', 'ss' ), 'ss_inpost_metabox', $type, 'side', 'low' );
13
  }
14
 
15
  }
22
 
23
  ?>
24
 
25
+ <input type="hidden" name="ss_inpost_nonce" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) ); ?>" />
26
 
27
  <p>
28
+ <label class="howto" for="_ss_sidebar"><span><?php _e( 'Primary Sidebar', 'ss' ); ?><span></label>
29
  <select name="_ss_sidebar" id="_ss_sidebar" style="width: 99%">
30
+ <option value=""><?php _e( 'Default', 'ss' ); ?></option>
31
  <?php
32
+ foreach ( (array) $_sidebars as $id => $info ) {
33
+ printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, genesis_get_custom_field( '_ss_sidebar' ), false), esc_html( $info['name'] ) );
34
  }
35
  ?>
36
  </select>
37
  </p>
38
  <?php
39
+ //* don't show the option if there are no 3 column layouts registered
40
  if ( ! ss_has_3_column_layouts() )
41
  return;
42
  ?>
43
  <p>
44
+ <label class="howto" for="_ss_sidebar_alt"><span><?php _e( 'Secondary Sidebar', 'ss' ); ?><span></label>
45
  <select name="_ss_sidebar_alt" id="_ss_sidebar_alt" style="width: 99%">
46
+ <option value=""><?php _e( 'Default', 'ss' ); ?></option>
47
  <?php
48
+ foreach ( (array) $_sidebars as $id => $info ) {
49
+ printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, genesis_get_custom_field( '_ss_sidebar_alt' ), false ), esc_html( $info['name'] ) );
50
  }
51
  ?>
52
  </select>
55
  <?php
56
  }
57
 
58
+ add_action( 'save_post', 'ss_inpost_metabox_save', 1, 2 );
59
  /**
60
  * This bit of code saves the sidebars chosen as post meta.
61
  */
 
62
  function ss_inpost_metabox_save( $post_id, $post ) {
63
 
64
+ //* verify the nonce
65
  if ( !isset($_POST['ss_inpost_nonce']) || !wp_verify_nonce( $_POST['ss_inpost_nonce'], plugin_basename(__FILE__) ) )
66
  return $post->ID;
67
 
68
+ //* don't try to save the data under autosave, ajax, or future post.
69
  if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;
70
  if ( defined('DOING_AJAX') && DOING_AJAX ) return;
71
  if ( defined('DOING_CRON') && DOING_CRON ) return;
72
 
73
+ //* is the user allowed to edit the post or page?
74
+ if ( ( 'page' == $_POST['post_type'] && ! current_user_can( 'edit_page', $post->ID ) ) || ! current_user_can( 'edit_post', $post->ID ) )
75
  return $post->ID;
76
 
77
  $_sidebars = array(
78
+ '_ss_sidebar' => $_POST['_ss_sidebar'],
79
+ '_ss_sidebar_alt' => $_POST['_ss_sidebar_alt'],
80
  );
81
 
82
+ //* store the custom fields
83
  foreach ( $_sidebars as $key => $value ) {
84
 
85
+ //* don't try to store data during revision save
86
+ if ( 'revision' === $post->post_type )
87
+ return;
88
 
89
  if ( $value ) {
 
90
  update_post_meta($post->ID, $key, $value);
91
  } else {
 
92
  delete_post_meta($post->ID, $key);
93
  }
94
 
95
  }
96
 
97
+ }
includes/term.php CHANGED
@@ -27,16 +27,16 @@ function ss_term_sidebar($tag, $taxonomy) {
27
 
28
  ?>
29
 
30
- <h3><?php _e('Sidebar Options', 'ss'); ?></h3>
31
  <table class="form-table">
32
 
33
  <tr class="form-field">
34
- <th scope="row" valign="top"><label for="meta[_ss_sidebar]"><?php _e('Primary Sidebar', 'ss'); ?></label></th>
35
  <td>
36
  <select name="meta[_ss_sidebar]" id="meta[_ss_sidebar]" style="padding-right: 10px;">
37
- <option value=""><?php _e('Default', 'ss'); ?></option>
38
  <?php
39
- foreach ( (array)$_sidebars as $id => $info ) {
40
  printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, $tag->meta['_ss_sidebar'] , false), esc_html( $info['name'] ) );
41
  }
42
  ?>
@@ -48,12 +48,12 @@ function ss_term_sidebar($tag, $taxonomy) {
48
  if ( ss_has_3_column_layouts() ) {
49
  ?>
50
  <tr class="form-field">
51
- <th scope="row" valign="top"><label for="meta[_ss_sidebar_alt]"><?php _e('Secondary Sidebar', 'ss'); ?></label></th>
52
  <td>
53
  <select name="meta[_ss_sidebar_alt]" id="meta[_ss_sidebar_alt]" style="padding-right: 10px;">
54
- <option value=""><?php _e('Default', 'ss'); ?></option>
55
  <?php
56
- foreach ( (array)$_sidebars as $id => $info ) {
57
  printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, $tag->meta['_ss_sidebar_alt'] , false), esc_html( $info['name'] ) );
58
  }
59
  ?>
@@ -66,4 +66,4 @@ function ss_term_sidebar($tag, $taxonomy) {
66
  </table>
67
 
68
  <?php
69
- }
27
 
28
  ?>
29
 
30
+ <h3><?php _e( 'Sidebar Options', 'ss' ); ?></h3>
31
  <table class="form-table">
32
 
33
  <tr class="form-field">
34
+ <th scope="row" valign="top"><label for="meta[_ss_sidebar]"><?php _e( 'Primary Sidebar', 'ss' ); ?></label></th>
35
  <td>
36
  <select name="meta[_ss_sidebar]" id="meta[_ss_sidebar]" style="padding-right: 10px;">
37
+ <option value=""><?php _e( 'Default', 'ss' ); ?></option>
38
  <?php
39
+ foreach ( (array) $_sidebars as $id => $info ) {
40
  printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, $tag->meta['_ss_sidebar'] , false), esc_html( $info['name'] ) );
41
  }
42
  ?>
48
  if ( ss_has_3_column_layouts() ) {
49
  ?>
50
  <tr class="form-field">
51
+ <th scope="row" valign="top"><label for="meta[_ss_sidebar_alt]"><?php _e( 'Secondary Sidebar', 'ss' ); ?></label></th>
52
  <td>
53
  <select name="meta[_ss_sidebar_alt]" id="meta[_ss_sidebar_alt]" style="padding-right: 10px;">
54
+ <option value=""><?php _e( 'Default', 'ss' ); ?></option>
55
  <?php
56
+ foreach ( (array) $_sidebars as $id => $info ) {
57
  printf( '<option value="%s" %s>%s</option>', esc_html( $id ), selected( $id, $tag->meta['_ss_sidebar_alt'] , false), esc_html( $info['name'] ) );
58
  }
59
  ?>
66
  </table>
67
 
68
  <?php
69
+ }
includes/views/edit.php CHANGED
@@ -5,35 +5,35 @@ if ( array_key_exists( $_REQUEST['id'], (array) $_sidebars ) ) {
5
  wp_die( __( 'Nice try, partner. But that sidebar doesn\'t exist. Click back and try again.', 'ss' ) );
6
  }
7
 
8
- screen_icon('themes'); ?>
9
- <h2><?php _e('Edit Sidebar', 'ss'); ?></h2>
10
 
11
  <form method="post" action="<?php echo admin_url( 'admin.php?page=simple-sidebars&amp;action=edit' ); ?>">
12
- <?php wp_nonce_field('simple-sidebars-action_edit-sidebar'); ?>
13
 
14
  <table class="form-table">
15
 
16
  <tr class="form-field">
17
- <th scope="row" valign="top"><label for="edit_sidebar[name]"><?php _e('Name', 'ss'); ?></label></th>
18
  <td><input name="edit_sidebar[name]" id="edit_sidebar[name]" type="text" value="<?php echo esc_html( $_sidebar['name'] ); ?>" size="40" />
19
- <p class="description"><?php _e('A recognizable name for your new sidebar widget area', 'ss'); ?></p></td>
20
  </tr>
21
 
22
  <tr class="form-field">
23
- <th scope="row" valign="top"><label for="edit_sidebar[id]"><?php _e('ID', 'ss'); ?></label></th>
24
  <td>
25
  <input type="text" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" disabled="disabled" />
26
  <input name="edit_sidebar[id]" id="edit_sidebar[id]" type="hidden" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" />
27
- <p class="description"><?php _e('The unique ID is used to register the sidebar widget area (cannot be changed)', 'ss'); ?></p></td>
28
  </tr>
29
 
30
  <tr class="form-field">
31
- <th scope="row" valign="top"><label for="edit_sidebar[description]"><?php _e('Description', 'ss'); ?></label></th>
32
  <td><textarea name="edit_sidebar[description]" id="edit_sidebar[description]" rows="3" cols="50" style="width: 97%;"><?php echo esc_html( $_sidebar['description'] ); ?></textarea></td>
33
  </tr>
34
 
35
  </table>
36
 
37
- <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php _e('Update', 'ss'); ?>" /></p>
38
 
39
- </form>
5
  wp_die( __( 'Nice try, partner. But that sidebar doesn\'t exist. Click back and try again.', 'ss' ) );
6
  }
7
 
8
+ screen_icon( 'themes' ); ?>
9
+ <h2><?php _e( 'Edit Sidebar', 'ss' ); ?></h2>
10
 
11
  <form method="post" action="<?php echo admin_url( 'admin.php?page=simple-sidebars&amp;action=edit' ); ?>">
12
+ <?php wp_nonce_field( 'simple-sidebars-action_edit-sidebar' ); ?>
13
 
14
  <table class="form-table">
15
 
16
  <tr class="form-field">
17
+ <th scope="row" valign="top"><label for="edit_sidebar[name]"><?php _e( 'Name', 'ss' ); ?></label></th>
18
  <td><input name="edit_sidebar[name]" id="edit_sidebar[name]" type="text" value="<?php echo esc_html( $_sidebar['name'] ); ?>" size="40" />
19
+ <p class="description"><?php _e( 'A recognizable name for your new sidebar widget area', 'ss' ); ?></p></td>
20
  </tr>
21
 
22
  <tr class="form-field">
23
+ <th scope="row" valign="top"><label for="edit_sidebar[id]"><?php _e( 'ID', 'ss' ); ?></label></th>
24
  <td>
25
  <input type="text" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" disabled="disabled" />
26
  <input name="edit_sidebar[id]" id="edit_sidebar[id]" type="hidden" value="<?php echo esc_html( $_REQUEST['id'] ); ?>" size="40" />
27
+ <p class="description"><?php _e( 'The unique ID is used to register the sidebar widget area (cannot be changed)', 'ss' ); ?></p></td>
28
  </tr>
29
 
30
  <tr class="form-field">
31
+ <th scope="row" valign="top"><label for="edit_sidebar[description]"><?php _e( 'Description', 'ss' ); ?></label></th>
32
  <td><textarea name="edit_sidebar[description]" id="edit_sidebar[description]" rows="3" cols="50" style="width: 97%;"><?php echo esc_html( $_sidebar['description'] ); ?></textarea></td>
33
  </tr>
34
 
35
  </table>
36
 
37
+ <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php _e( 'Update', 'ss' ); ?>" /></p>
38
 
39
+ </form>
includes/views/main.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php screen_icon('themes'); ?>
2
- <h2><?php _e('Genesis - Simple Sidebars', 'ss'); ?></h2>
3
 
4
  <div id="col-container">
5
 
6
  <div id="col-right">
7
  <div class="col-wrap">
8
 
9
- <h3><?php _e('Current Sidebars', 'ss'); ?></h3>
10
  <table class="widefat tag fixed" cellspacing="0">
11
  <thead>
12
  <tr>
13
- <th scope="col" id="name" class="manage-column column-name"><?php _e('Name', 'ss'); ?></th>
14
- <th scope="col" class="manage-column column-slug"><?php _e('ID', 'ss'); ?></th>
15
- <th scope="col" id="description" class="manage-column column-description"><?php _e('Description', 'ss'); ?></th>
16
  </tr>
17
  </thead>
18
 
19
  <tfoot>
20
  <tr>
21
- <th scope="col" class="manage-column column-name"><?php _e('Name', 'ss'); ?></th>
22
- <th scope="col" class="manage-column column-slug"><?php _e('ID', 'ss'); ?></th>
23
- <th scope="col" class="manage-column column-description"><?php _e('Description', 'ss'); ?></th>
24
  </tr>
25
  </tfoot>
26
 
@@ -39,29 +39,29 @@
39
 
40
 
41
  <div class="form-wrap">
42
- <h3><?php _e('Add New Sidebar', 'ss'); ?></h3>
43
 
44
  <form method="post" action="<?php echo admin_url( 'admin.php?page=simple-sidebars&amp;action=create' ); ?>">
45
- <?php wp_nonce_field('simple-sidebars-action_create-sidebar'); ?>
46
 
47
  <div class="form-field form-required">
48
- <label for="sidebar-name"><?php _e('Name', 'ss'); ?></label>
49
  <input name="new_sidebar[name]" id="sidebar-name" type="text" value="" size="40" aria-required="true" />
50
- <p><?php _e('A recognizable name for your new sidebar widget area', 'ss'); ?></p>
51
  </div>
52
 
53
  <div class="form-field">
54
- <label for="sidebar-id"><?php _e('ID', 'ss'); ?></label>
55
  <input name="new_sidebar[id]" id="sidebar-id" type="text" value="" size="40" />
56
- <p><?php _e('The unique ID is used to register the sidebar widget area', 'ss'); ?></p>
57
  </div>
58
 
59
  <div class="form-field">
60
- <label for="sidebar-description"><?php _e('Description', 'ss'); ?></label>
61
  <textarea name="new_sidebar[description]" id="sidebar-description" rows="5" cols="40"></textarea>
62
  </div>
63
 
64
- <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php _e('Add New Sidebar', 'ss'); ?>" /></p>
65
  </form></div>
66
 
67
  </div>
1
+ <?php screen_icon( 'themes' ); ?>
2
+ <h2><?php _e( 'Genesis - Simple Sidebars', 'ss' ); ?></h2>
3
 
4
  <div id="col-container">
5
 
6
  <div id="col-right">
7
  <div class="col-wrap">
8
 
9
+ <h3><?php _e( 'Current Sidebars', 'ss' ); ?></h3>
10
  <table class="widefat tag fixed" cellspacing="0">
11
  <thead>
12
  <tr>
13
+ <th scope="col" id="name" class="manage-column column-name"><?php _e( 'Name', 'ss' ); ?></th>
14
+ <th scope="col" class="manage-column column-slug"><?php _e( 'ID', 'ss' ); ?></th>
15
+ <th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'ss' ); ?></th>
16
  </tr>
17
  </thead>
18
 
19
  <tfoot>
20
  <tr>
21
+ <th scope="col" class="manage-column column-name"><?php _e( 'Name', 'ss' ); ?></th>
22
+ <th scope="col" class="manage-column column-slug"><?php _e( 'ID', 'ss' ); ?></th>
23
+ <th scope="col" class="manage-column column-description"><?php _e( 'Description', 'ss' ); ?></th>
24
  </tr>
25
  </tfoot>
26
 
39
 
40
 
41
  <div class="form-wrap">
42
+ <h3><?php _e( 'Add New Sidebar', 'ss' ); ?></h3>
43
 
44
  <form method="post" action="<?php echo admin_url( 'admin.php?page=simple-sidebars&amp;action=create' ); ?>">
45
+ <?php wp_nonce_field( 'simple-sidebars-action_create-sidebar' ); ?>
46
 
47
  <div class="form-field form-required">
48
+ <label for="sidebar-name"><?php _e( 'Name', 'ss' ); ?></label>
49
  <input name="new_sidebar[name]" id="sidebar-name" type="text" value="" size="40" aria-required="true" />
50
+ <p><?php _e( 'A recognizable name for your new sidebar widget area', 'ss' ); ?></p>
51
  </div>
52
 
53
  <div class="form-field">
54
+ <label for="sidebar-id"><?php _e( 'ID', 'ss' ); ?></label>
55
  <input name="new_sidebar[id]" id="sidebar-id" type="text" value="" size="40" />
56
+ <p><?php _e( 'The unique ID is used to register the sidebar widget area', 'ss' ); ?></p>
57
  </div>
58
 
59
  <div class="form-field">
60
+ <label for="sidebar-description"><?php _e( 'Description', 'ss' ); ?></label>
61
  <textarea name="new_sidebar[description]" id="sidebar-description" rows="5" cols="40"></textarea>
62
  </div>
63
 
64
+ <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php _e( 'Add New Sidebar', 'ss' ); ?>" /></p>
65
  </form></div>
66
 
67
  </div>
languages/ss-fr_FR.mo DELETED
Binary file
languages/ss-fr_FR.po DELETED
@@ -1,173 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: Simple Sidebar\n"
9
- "Report-Msgid-Bugs-To: \n"
10
- "POT-Creation-Date: 2011-08-06 21:23-0300\n"
11
- "PO-Revision-Date: 2012-12-03 08:27+0100\n"
12
- "Last-Translator: gregoire noyelle <hello@gregoirenoyelle.com>\n"
13
- "Language-Team: Grégoire Noyelle <hello@gregoirenoyelle.com>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "Plural-Forms: nplurals=2;plural=n>1;\n"
18
- "Language: French\n"
19
- "X-Poedit-SourceCharset: UTF-8\n"
20
- "X-Generator: Poedit 1.5.4\n"
21
-
22
- #: admin.php:17
23
- msgid "Simple Sidebars"
24
- msgstr "Barre latérale"
25
-
26
- #: admin.php:66
27
- msgid ""
28
- "Nice try, partner. But that sidebar doesn't exist. Click back and try again."
29
- msgstr ""
30
- "Chouette essai. Mais cette barre latérale n'existe pas. Merci de revenir en "
31
- "arrière et d'essayer à nouveau"
32
-
33
- #: admin.php:72
34
- msgid "Edit Sidebar"
35
- msgstr "Editer la Barre Latérale"
36
-
37
- #: admin.php:79 admin.php:117 admin.php:125 admin.php:152
38
- msgid "Name"
39
- msgstr "Nom"
40
-
41
- #: admin.php:81 admin.php:154
42
- msgid "A recognizable name for your new sidebar widget area"
43
- msgstr "Un nom reconnaissable qui apparaîtra dans vos réglages"
44
-
45
- #: admin.php:85 admin.php:118 admin.php:126 admin.php:158
46
- msgid "ID"
47
- msgstr "ID (identifiant) ATTENTION VOIR NOTE"
48
-
49
- #: admin.php:89
50
- msgid ""
51
- "The unique ID is used to register the sidebar widget area (cannot be changed)"
52
- msgstr ""
53
- "Le ID unique est utilisé pour enregistrer la nouvelle zone de widget pour la "
54
- "Barre Latérale (ne peux pas être changé). <b>ATTENTION</b> à ne pas mettre "
55
- "de lettre accentuées, pas d'espace ou autre signes que des lettres. Le plus "
56
- "simple est de prendre des minuscules et des tirets à la place des espaces. "
57
-
58
- #: admin.php:93 admin.php:119 admin.php:127 admin.php:164
59
- msgid "Description"
60
- msgstr "Description"
61
-
62
- #: admin.php:99
63
- msgid "Update"
64
- msgstr "Mise à jour"
65
-
66
- #: admin.php:106
67
- msgid "Genesis - Simple Sidebars"
68
- msgstr "Genesis - Barre latérale"
69
-
70
- #: admin.php:113
71
- msgid "Current Sidebars"
72
- msgstr "Zones de Widgets activées"
73
-
74
- #: admin.php:146 admin.php:168
75
- msgid "Add New Sidebar"
76
- msgstr "Ajouter une nouvelle Barre Latérale"
77
-
78
- #: admin.php:160
79
- msgid "The unique ID is used to register the sidebar widget area"
80
- msgstr ""
81
- "Le ID unique est utilisé pour enregistrer la barre nouvelle zone de widget "
82
- "pour la Barre Latérale. <b>ATTENTION</b> à ne pas mettre de lettre "
83
- "accentuées, pas d'espace ou autre signes que des lettres. Le plus simple est "
84
- "de prendre des minuscules et des tirets à la place des espaces."
85
-
86
- #: functions.php:28
87
- msgid "Edit"
88
- msgstr "Editer"
89
-
90
- #: functions.php:29
91
- msgid "Delete"
92
- msgstr "Suprimer"
93
-
94
- #: functions.php:137
95
- msgid "Oops! Please choose a valid Name and ID for this sidebar"
96
- msgstr ""
97
- "Oups ! Merci de choisir un Nom valide et un ID pour cette Barre Latérale. "
98
- "<b>ATTENTION</b> à ne pas mettre de lettre accentuées, pas d'espace ou autre "
99
- "signes que des lettres. Le plus simple est de prendre des minuscules et des "
100
- "tirets à la place des espaces."
101
-
102
- #: functions.php:140
103
- msgid "Oops! That sidebar ID already exists"
104
- msgstr "Oups ! Ce ID de Barre Latérale existe déjà."
105
-
106
- #: functions.php:143
107
- msgid ""
108
- "Oops! You are trying to edit a sidebar that does not exist, or is not "
109
- "editable"
110
- msgstr ""
111
- "Oups ! Vous essayez d'éditer une Barre Latérale qui n'existe pas, ou qui "
112
- "n'est pas évitable."
113
-
114
- #: functions.php:146
115
- msgid ""
116
- "Oops! You are trying to delete a sidebar that does not exist, or cannot be "
117
- "deleted"
118
- msgstr ""
119
- "Oups ! Vous essayez de supprimer une Barre Latérale qui n'existe pas, ou qui "
120
- "ne peux pas être supprimée."
121
-
122
- #: functions.php:149
123
- msgid "Oops! Something went wrong. Try again."
124
- msgstr "Oups ! Quelque-chose va de travers. Essayez à nouveau"
125
-
126
- #: functions.php:165
127
- msgid "New sidebar successfully created!"
128
- msgstr "La nouvelle Barre Latérale a été créé avec succès!"
129
-
130
- #: functions.php:170
131
- msgid "Sidebar successfully edited!"
132
- msgstr "La Barre Latérale a été édité avec succès!"
133
-
134
- #: functions.php:175
135
- msgid "Sidebar successfully deleted."
136
- msgstr "La Barre Latérale a été supprimé avec succès!"
137
-
138
- #: inpost.php:10
139
- msgid "Sidebar Selection"
140
- msgstr "Sélection des Barres Latérales"
141
-
142
- #: inpost.php:22 term.php:29
143
- msgid "Primary Sidebar"
144
- msgstr "Barre Latérale 1"
145
-
146
- #: inpost.php:24 inpost.php:36 term.php:32 term.php:46
147
- msgid "Default"
148
- msgstr "Par défaut"
149
-
150
- #: inpost.php:34 term.php:43
151
- msgid "Secondary Sidebar"
152
- msgstr "Barre Latérale 2"
153
-
154
- #: plugin.php:21
155
- #, php-format
156
- msgid ""
157
- "Sorry, you can't activate unless you have installed <a href=\"%s\">Genesis</"
158
- "a>"
159
- msgstr ""
160
- "Désolé, vous ne pouvez pas activer ce plugin tant que vous n'avez pas "
161
- "installé <a href=\"%s\">Genesis</a>."
162
-
163
- #: plugin.php:26
164
- #, php-format
165
- msgid ""
166
- "Sorry, you cannot activate without <a href=\"%s\">Genesis %s</a> or greater"
167
- msgstr ""
168
- "Désolé, vous ne pouvez activer ce plugin sans <a href=\"%s\">Genesis %s</a> "
169
- "ou supérieur."
170
-
171
- #: term.php:25
172
- msgid "Sidebar Options"
173
- msgstr "Options des Barres Latérales"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin.php CHANGED
@@ -9,7 +9,7 @@ Author URI: http://www.nathanrice.net/
9
  Text Domain: ss
10
  Domain Path: /languages/
11
 
12
- Version: 1.0.0
13
 
14
  License: GNU General Public License v2.0 (or later)
15
  License URI: http://www.opensource.org/licenses/gpl-license.php
@@ -30,9 +30,8 @@ register_activation_hook( __FILE__, 'ss_activation_check' );
30
  */
31
  function ss_activation_check() {
32
 
33
- if ( 'genesis' != basename( TEMPLATEPATH ) ) {
34
- ss_deactivate( '1.8.0', '3.3' );
35
- }
36
 
37
  }
38
 
@@ -46,7 +45,7 @@ function ss_activation_check() {
46
  function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) {
47
 
48
  deactivate_plugins( plugin_basename( __FILE__ ) );
49
- wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'ss' ), $wp_version, 'http://www.studiopress.com/support/showthread.php?t=19576', $genesis_version ) );
50
 
51
  }
52
 
@@ -60,27 +59,27 @@ add_action( 'genesis_init', 'ss_genesis_init', 12 );
60
  */
61
  function ss_genesis_init() {
62
 
63
- /** Deactivate if not running Genesis 1.8.0 or greater */
64
  if ( ! class_exists( 'Genesis_Admin_Boxes' ) )
65
  add_action( 'admin_init', 'ss_deactivate', 10, 0 );
66
 
67
- /** Load translations */
68
  load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' );
69
 
70
- /** required hooks */
71
  add_action( 'get_header', 'ss_sidebars_init' );
72
  add_action( 'widgets_init', 'ss_register_sidebars' );
73
 
74
- /** The rest is admin stuff, so load only if we're in the admin area */
75
  if ( ! is_admin() )
76
  return;
77
 
78
- /** Include admin files */
79
  require_once( SS_PLUGIN_DIR . '/includes/admin.php' );
80
  require_once( SS_PLUGIN_DIR . '/includes/inpost.php' );
81
  require_once( SS_PLUGIN_DIR . '/includes/term.php' );
82
 
83
- /** let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit */
84
  add_action( 'init', 'ss_term_edit_init' );
85
 
86
  }
@@ -95,23 +94,18 @@ function ss_register_sidebars() {
95
 
96
  $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) );
97
 
98
- /** If no sidebars have been created, do nothing */
99
  if ( ! $_sidebars )
100
  return;
101
 
102
- /** Cycle through created sidebars, register them as widget areas */
103
  foreach ( (array) $_sidebars as $id => $info ) {
104
 
105
- register_sidebar( array(
106
- 'name' => esc_html( $info['name'] ),
107
- 'id' => $id,
108
  'description' => esc_html( $info['description'] ),
109
- 'editable' => 1,
110
-
111
- 'before_widget' => '<div id="%1$s" class="widget %2$s"><div class="widget-wrap">',
112
- 'after_widget' => "</div></div>\n",
113
- 'before_title' => '<h4 class="widgettitle">',
114
- 'after_title' => "</h4>\n"
115
  ) );
116
 
117
  }
9
  Text Domain: ss
10
  Domain Path: /languages/
11
 
12
+ Version: 2.0.0
13
 
14
  License: GNU General Public License v2.0 (or later)
15
  License URI: http://www.opensource.org/licenses/gpl-license.php
30
  */
31
  function ss_activation_check() {
32
 
33
+ if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.0.0', '>=' ) )
34
+ ss_deactivate( '2.0.0', '3.6' );
 
35
 
36
  }
37
 
45
  function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) {
46
 
47
  deactivate_plugins( plugin_basename( __FILE__ ) );
48
+ wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'simplehooks' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) );
49
 
50
  }
51
 
59
  */
60
  function ss_genesis_init() {
61
 
62
+ //* Deactivate if not running Genesis 1.8.0 or greater
63
  if ( ! class_exists( 'Genesis_Admin_Boxes' ) )
64
  add_action( 'admin_init', 'ss_deactivate', 10, 0 );
65
 
66
+ //* Load translations
67
  load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' );
68
 
69
+ //* required hooks
70
  add_action( 'get_header', 'ss_sidebars_init' );
71
  add_action( 'widgets_init', 'ss_register_sidebars' );
72
 
73
+ //* The rest is admin stuff, so load only if we're in the admin area
74
  if ( ! is_admin() )
75
  return;
76
 
77
+ //* Include admin files
78
  require_once( SS_PLUGIN_DIR . '/includes/admin.php' );
79
  require_once( SS_PLUGIN_DIR . '/includes/inpost.php' );
80
  require_once( SS_PLUGIN_DIR . '/includes/term.php' );
81
 
82
+ //* let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit
83
  add_action( 'init', 'ss_term_edit_init' );
84
 
85
  }
94
 
95
  $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) );
96
 
97
+ //* If no sidebars have been created, do nothing
98
  if ( ! $_sidebars )
99
  return;
100
 
101
+ //* Cycle through created sidebars, register them as widget areas
102
  foreach ( (array) $_sidebars as $id => $info ) {
103
 
104
+ genesis_register_sidebar( array(
105
+ 'name' => esc_html( $info['name'] ),
106
+ 'id' => $id,
107
  'description' => esc_html( $info['description'] ),
108
+ 'editable' => 1,
 
 
 
 
 
109
  ) );
110
 
111
  }
readme.txt CHANGED
@@ -2,15 +2,15 @@
2
  Contributors: nathanrice, wpmuguru
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
4
  Tags: hooks, genesis, genesiswp, studiopress
5
- Requires at least: 3.3
6
- Tested up to: 3.3.1
7
- Stable tag: 1.0.0
8
 
9
- This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis.
10
 
11
  == Description ==
12
 
13
- This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis.
14
 
15
  Creating widget areas programmatically, then using conditional logic to properly assign them to sidebar locations can be a complex task for a beginner. This plugin allows you to do all this from a simple administration menu, and assign widget areas to sidebar locations with simple drop-down menus within the post/page edit screens, or when editing a tag or category.
16
 
@@ -60,5 +60,9 @@ Not in the way you're probably thinking. The markup surrounding the widget area
60
  * Remove secondary selection when no 3 column layouts are enabled
61
 
62
  = 1.0.0 =
63
- * Increase requirement to WordPress 3.3 and Genesis 1.8.0
64
- * Switch to Genesis Admin class to build admin menu.
 
 
 
 
2
  Contributors: nathanrice, wpmuguru
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118
4
  Tags: hooks, genesis, genesiswp, studiopress
5
+ Requires at least: 3.6
6
+ Tested up to: 3.6
7
+ Stable tag: 2.0.0
8
 
9
+ This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis.
10
 
11
  == Description ==
12
 
13
+ This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis.
14
 
15
  Creating widget areas programmatically, then using conditional logic to properly assign them to sidebar locations can be a complex task for a beginner. This plugin allows you to do all this from a simple administration menu, and assign widget areas to sidebar locations with simple drop-down menus within the post/page edit screens, or when editing a tag or category.
16
 
60
  * Remove secondary selection when no 3 column layouts are enabled
61
 
62
  = 1.0.0 =
63
+ * Reorganize theme files
64
+ * Standards
65
+
66
+ = 2.0.0 =
67
+ * Compatibility with Genesis 2.0
68
+ * Standards