WooSidebars - Version 1.3.0

Version Description

Optimisation update.

Download this release

Release Info

Developer mattyza
Plugin Icon wp plugin WooSidebars
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.2 to 1.3.0

CONTRIBUTING.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # How to contribute
2
+
3
+ Community made patches, localisations, bug reports and contributions are always welcome and are crucial to ensure WooSidebars remains the #1 widget area management plugin for WordPress. ;)
4
+
5
+ When contributing please ensure you follow the guidelines below so that we can keep on top of things.
6
+
7
+ __Note:__
8
+
9
+ GitHub is for *bug reports and contributions only* - if you have a support question or a request for a customization, don't post here. Use [WooThemes Support](http://support.woothemes.com) for customer support, [WordPress.org](http://wordpress.org/support/plugin/woosidebars) for community support, and for customisations we recommend one of the following services:
10
+
11
+ - Codeable: http://codeable.io/
12
+ - Tweaky: https://www.tweaky.com/
13
+ - Affiliated Woo Workers: http://www.woothemes.com/affiliated-woo-workers/
14
+
15
+ ## Getting Started
16
+
17
+ * Make sure you have a [GitHub account](https://github.com/signup/free)
18
+ * Submit a ticket for your issue, assuming one does not already exist.
19
+ * Clearly describe the issue including steps to reproduce when it is a bug.
20
+ * Make sure you fill in the earliest version that you know has the issue.
21
+
22
+ ## Making Changes
23
+
24
+ * Fork the repository on GitHub.
25
+ * Make the changes to your forked repository.
26
+ * **Ensure you stick to the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards).**
27
+ * Ensure you use LF line endings - no crazy windows line endings. :)
28
+ * When committing, reference your issue (#1234) and include a note about the fix.
29
+ * Push the changes to your fork and submit a pull request on the latest release branch of the WooSidebars repository.
30
+ * Release branches start their branch name with `release-`.
31
+
32
+ At this point you're waiting on us to merge your pull request. We'll review all pull requests, and make suggestions and changes if necessary.
33
+
34
+ # Additional Resources
35
+
36
+ * [General GitHub documentation](http://help.github.com/)
37
+ * [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
38
+ * [WooSidebars Docs](http://docs.woothemes.com/documentation/plugins/woosidebars/)
39
+ * [WooThemes Support](http://support.woothemes.com/)
assets/css/admin.css CHANGED
@@ -10,19 +10,27 @@
10
  .woo-conditions .conditions-tabs li a { padding:0;margin:0;border:0;border:1px solid #d5d5d5;border-bottom:0;float:left;padding:9px 9px;background:#ececec;text-decoration:none;color:#555;-moz-border-radius-topleft:3px;-moz-border-radius-topright:3px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;-webkit-box-shadow:inset 0 1px 0 1px rgba(255, 255, 255, 0.5);-moz-box-shadow:inset 0 1px 0 1px rgba(255, 255, 255, 0.5);box-shadow:inset 0 1px 0 1px rgba(255, 255, 255, 0.5); }
11
  .woo-conditions .conditions-tabs li.ui-state-active {}
12
  .woo-conditions .conditions-tabs li.ui-state-active a { background:#f8f8f8;color:#555;background-image:linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-o-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-moz-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-webkit-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-ms-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #ffffff), color-stop(1, #f8f8f8)); }
13
- #woo-conditions.postbox .inside { background: #FFFFFF; padding: 0; margin: 0; }
14
- #woo-conditions.postbox .inside .condition-tab { background: #FFFFFF; padding: 2px 18px; }
15
- #woo-conditions.postbox .inside .condition-tab h4 { margin-top: 10px; }
16
 
17
- #woo-conditions.postbox .conditions-column { display: block; margin: 0 20px 20px 0; }
18
 
19
- #woo-conditions.postbox .conditions-tabs-inner { display: block; padding: 10px 0; }
20
  .conditions-tabs-inner li { display: inline; padding: .2em; line-height: 2; margin: 0; }
21
  .conditions-tabs-inner li a { margin-right: 5px; text-decoration: none; }
22
  .conditions-tabs-inner li.ui-state-active a { color: #000000; font-weight: bold; }
23
- #woo-conditions.postbox .inside .condition-tab .condition-tab { padding: 2px 0px; }
24
 
25
  .view-switch { display: none; }
26
 
27
  #preview-action { display: none; }
28
- #visibility.misc-pub-section { display: none; }
 
 
 
 
 
 
 
 
10
  .woo-conditions .conditions-tabs li a { padding:0;margin:0;border:0;border:1px solid #d5d5d5;border-bottom:0;float:left;padding:9px 9px;background:#ececec;text-decoration:none;color:#555;-moz-border-radius-topleft:3px;-moz-border-radius-topright:3px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;-webkit-box-shadow:inset 0 1px 0 1px rgba(255, 255, 255, 0.5);-moz-box-shadow:inset 0 1px 0 1px rgba(255, 255, 255, 0.5);box-shadow:inset 0 1px 0 1px rgba(255, 255, 255, 0.5); }
11
  .woo-conditions .conditions-tabs li.ui-state-active {}
12
  .woo-conditions .conditions-tabs li.ui-state-active a { background:#f8f8f8;color:#555;background-image:linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-o-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-moz-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-webkit-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-ms-linear-gradient(bottom, #ffffff 0%, #f8f8f8 100%);background-image:-webkit-gradient(linear, left bottom, left top, color-stop(0, #ffffff), color-stop(1, #f8f8f8)); }
13
+ #woosidebars-conditions.postbox .inside { background: #FFFFFF; padding: 0; margin: 0; }
14
+ #woosidebars-conditions.postbox .inside .condition-tab { background: #FFFFFF; padding: 2px 18px; }
15
+ #woosidebars-conditions.postbox .inside .condition-tab h4 { margin-top: 10px; }
16
 
17
+ #woosidebars-conditions.postbox .conditions-column { display: block; margin: 0 20px 20px 0; }
18
 
19
+ #woosidebars-conditions.postbox .conditions-tabs-inner { display: block; padding: 10px 0; }
20
  .conditions-tabs-inner li { display: inline; padding: .2em; line-height: 2; margin: 0; }
21
  .conditions-tabs-inner li a { margin-right: 5px; text-decoration: none; }
22
  .conditions-tabs-inner li.ui-state-active a { color: #000000; font-weight: bold; }
23
+ #woosidebars-conditions.postbox .inside .condition-tab .condition-tab { padding: 2px 0px; }
24
 
25
  .view-switch { display: none; }
26
 
27
  #preview-action { display: none; }
28
+ #visibility.misc-pub-section { display: none; }
29
+
30
+ /* Reset and override jQueryUI styling, used by several plugins. */
31
+ #woosidebars-conditions.postbox .woo-conditions { background: none; border: 0; -webkit-border-radius: 0; -moz-border-radius: 0; -o-border-radius: 0; border-radius: 0; font-size: 12px; font-weight: normal; font-family: sans-serif; }
32
+ #woosidebars-conditions.postbox .conditions-tabs, #woosidebars-conditions.postbox .conditions-tabs-inner { border: 0; -webkit-border-radius: 0; -moz-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
33
+ #woosidebars-conditions.postbox .conditions-tabs-inner { background: none; }
34
+ #woosidebars-conditions.postbox .conditions-tabs li, #woosidebars-conditions.postbox .conditions-tabs-inner li { background: none; border: 0; -webkit-border-radius: 0; -moz-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
35
+ #woosidebars-conditions.postbox .conditions-tabs li a, #woosidebars-conditions.postbox .conditions-tabs-inner li a { outline: none; }
36
+ #woosidebars-conditions.postbox .conditions-tabs-inner li a { padding: 0 0.1em; }
assets/js/admin.js CHANGED
@@ -2,23 +2,23 @@ jQuery( document ).ready( function () {
2
  jQuery( '.woo-conditions.tabs' ).tabs();
3
  jQuery( '.woo-conditions.tabs .inner-tabs' ).tabs();
4
 
5
- jQuery( '#woo-conditions .advanced-settings a' ).click( function ( e ) {
6
- jQuery( '#woo-conditions .tabs li.advanced' ).toggleClass( 'hide' );
7
 
8
  var new_status = '1'; // Do display.
9
- if ( jQuery( '#woo-conditions .tabs li.advanced' ).hasClass( 'hide' ) ) {
10
  new_status = '0'; // Don't display.
11
  }
12
 
13
- // Perform the AJAX call.
14
  jQuery.post(
15
- ajaxurl,
16
- {
17
- action : 'woosidebars-toggle-advanced-items',
18
- woosidebars_advanced_noonce : woosidebars_localized_data.woosidebars_advanced_noonce,
19
  new_status: new_status
20
  },
21
- function( response ) {}
22
  );
23
 
24
  return false;
2
  jQuery( '.woo-conditions.tabs' ).tabs();
3
  jQuery( '.woo-conditions.tabs .inner-tabs' ).tabs();
4
 
5
+ jQuery( '#woosidebars-conditions .advanced-settings a' ).click( function ( e ) {
6
+ jQuery( '#woosidebars-conditions .tabs li.advanced' ).toggleClass( 'hide' );
7
 
8
  var new_status = '1'; // Do display.
9
+ if ( jQuery( '#woosidebars-conditions .tabs li.advanced' ).hasClass( 'hide' ) ) {
10
  new_status = '0'; // Don't display.
11
  }
12
 
13
+ // Perform the AJAX call.
14
  jQuery.post(
15
+ ajaxurl,
16
+ {
17
+ action : 'woosidebars-toggle-advanced-items',
18
+ woosidebars_advanced_noonce : woosidebars_localized_data.woosidebars_advanced_noonce,
19
  new_status: new_status
20
  },
21
+ function( response ) {}
22
  );
23
 
24
  return false;
changelog.txt CHANGED
@@ -1,5 +1,11 @@
1
  *** WooSidebars Changelog ***
2
 
 
 
 
 
 
 
3
  2013.03.08 - version 1.2.2
4
  * /classes/class-woo-sidebars.php - Changed capability for displaying the "Widget Areas" menu to use "edit_theme_options" instead of "switch_themes".
5
  * /assets/css/admin.css - Minor styling adjustments. Fixes admin styling when jquery-ui-fresh CSS is loaded by other plugins.
1
  *** WooSidebars Changelog ***
2
 
3
+ 2013.08.12 - version 1.3.0
4
+ * /assets/css/admin.css - Replace all instances of #woo-conditions with #woosidebars-conditions to match the renamed meta box. Add basic jQueryUI styling reset to prevent visual inconsistency when jQueryUI is loaded via a third-party plugin.
5
+ * /assets/js/admin.js - Adjust the JavaScript logic to use the new "woosidebars-conditions" selector instead of "woo-conditions" for toggling advanced options on and off.
6
+ * /classes/class-woo-conditions.php - Rename "woo-conditions" meta box to "woosidebars-conditions". Fixes display bug with the WPML "Multilingual Content Setup" meta box. Replaces all instances of &$this with $this. Introduces upper_limit property and woosidebars_upper_limit filter. Addresses logic for the "single" condition type.
7
+ * /classes/class-woo-sidebars.php - Replaces all instances of &$this with $this. Introduces upper_limit property and woosidebars_upper_limit filter.
8
+
9
  2013.03.08 - version 1.2.2
10
  * /classes/class-woo-sidebars.php - Changed capability for displaying the "Widget Areas" menu to use "edit_theme_options" instead of "switch_themes".
11
  * /assets/css/admin.css - Minor styling adjustments. Fixes admin styling when jquery-ui-fresh CSS is loaded by other plugins.
classes/class-woo-conditions.php CHANGED
@@ -18,6 +18,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
18
  * public $conditions_headings
19
  * public $conditions_reference
20
  * public $meta_box_settings
 
21
  * private $assets_url
22
  * private $plugin_url
23
  *
@@ -42,39 +43,41 @@ class Woo_Conditions {
42
  public $conditions_headings = array();
43
  public $conditions_reference = array();
44
  public $meta_box_settings = array();
 
45
  private $assets_url;
46
  private $plugin_url;
47
-
48
  /**
49
  * __construct function.
50
- *
51
  * @access public
52
  * @return void
53
  */
54
  public function __construct () {
55
  $this->meta_box_settings['title'] = __( 'Conditions', 'woosidebars' );
56
-
 
57
  if ( is_admin() && get_post_type() == $this->token || ! get_post_type() ) {
58
- add_action( 'admin_menu', array( &$this, 'meta_box_setup' ), 20 );
59
- add_action( 'save_post', array( &$this, 'meta_box_save' ) );
60
  }
61
-
62
  /* Plugin URL/path settings. */
63
  $this->plugin_url = str_replace( '/classes', '', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) );
64
  $this->assets_url = $this->plugin_url . '/assets';
65
 
66
  if ( is_admin() ) {
67
- add_action( 'admin_print_scripts', array( &$this, 'enqueue_scripts' ), 12 );
68
  }
69
 
70
- add_action( 'get_header', array( &$this, 'get_conditions' ) );
71
 
72
- add_action( 'wp_ajax_woosidebars-toggle-advanced-items', array( &$this, 'ajax_toggle_advanced_items' ) );
73
  } // End __construct()
74
-
75
  /**
76
  * get_conditions function.
77
- *
78
  * @access public
79
  * @return void
80
  */
@@ -85,20 +88,20 @@ class Woo_Conditions {
85
 
86
  $this->conditions = array_reverse( $this->conditions );
87
  } // End get_conditions()
88
-
89
  /**
90
  * determine_conditions function.
91
- *
92
  * @access public
93
  * @return void
94
  */
95
- public function determine_conditions () {
96
  $this->is_hierarchy();
97
  $this->is_taxonomy();
98
  $this->is_post_type_archive();
99
- $this->is_page_template();
100
  } // End determine_conditions()
101
-
102
  /**
103
  * setup_default_conditions_reference function.
104
  *
@@ -109,35 +112,35 @@ class Woo_Conditions {
109
  public function setup_default_conditions_reference () {
110
  $conditions = array();
111
  $conditions_headings = array();
112
-
113
  // Get an array of the different post status labels, in case we need it later.
114
  $post_statuses = get_post_statuses();
115
 
116
  // Pages
117
  $conditions['pages'] = array();
118
-
119
  $statuses_string = join( ',', array_keys( $post_statuses ) );
120
  $pages = get_pages( array( 'post_status' => $statuses_string ) );
121
-
122
  if ( count( $pages ) > 0 ) {
123
-
124
  $conditions_headings['pages'] = __( 'Pages', 'woosidebars' );
125
-
126
  foreach ( $pages as $k => $v ) {
127
  $token = 'post-' . $v->ID;
128
- $label = $v->post_title;
129
  if ( 'publish' != $v->post_status ) {
130
- $label .= ' <strong>(' . $post_statuses[$v->post_status] . ')</strong>';
131
  }
132
 
133
  $conditions['pages'][$token] = array(
134
- 'label' => $label,
135
  'description' => sprintf( __( 'The "%s" page', 'woosidebars' ), $v->post_title )
136
  );
137
  }
138
 
139
  }
140
-
141
  $args = array(
142
  'show_ui' => true,
143
  'public' => true,
@@ -146,13 +149,13 @@ class Woo_Conditions {
146
  );
147
 
148
  $post_types = get_post_types( $args, 'object' );
149
-
150
  // Set certain post types that aren't allowed to have custom sidebars.
151
  $disallowed_types = array( 'slide' );
152
 
153
  // Make the array filterable.
154
  $disallowed_types = apply_filters( 'woosidebars_disallowed_post_types', $disallowed_types );
155
-
156
  if ( count( $post_types ) ) {
157
  foreach ( $post_types as $k => $v ) {
158
  if ( in_array( $k, $disallowed_types ) ) {
@@ -160,7 +163,7 @@ class Woo_Conditions {
160
  }
161
  }
162
  }
163
-
164
  // Add per-post support for any post type that supports it.
165
  $args = array(
166
  'show_ui' => true,
@@ -170,7 +173,7 @@ class Woo_Conditions {
170
  );
171
 
172
  $built_in_post_types = get_post_types( $args, 'object' );
173
-
174
  foreach ( $built_in_post_types as $k => $v ) {
175
  if ( $k == 'post' ) {
176
  $post_types[$k] = $v;
@@ -180,13 +183,13 @@ class Woo_Conditions {
180
 
181
  foreach ( $post_types as $k => $v ) {
182
  if ( ! post_type_supports( $k, 'woosidebars' ) ) { continue; }
183
-
184
  $conditions_headings[$k] = $v->labels->name;
185
-
186
- $query_args = array( 'numberposts' => -1, 'post_type' => $k, 'meta_key' => '_enable_sidebar', 'meta_value' => 'yes', 'meta_compare' => '=', 'post_status' => 'any' );
187
-
188
  $posts = get_posts( $query_args );
189
-
190
  if ( count( $posts ) > 0 ) {
191
  foreach ( $posts as $i => $j ) {
192
  $label = $j->post_title;
@@ -194,142 +197,141 @@ class Woo_Conditions {
194
  $label .= ' <strong>(' . $post_statuses[$j->post_status] . ')</strong>';
195
  }
196
  $conditions[$k]['post' . '-' . $j->ID] = array(
197
- 'label' => $label,
198
  'description' => sprintf( __( 'A custom sidebar for "%s"', 'woosidebars' ), esc_attr( $j->post_title ) )
199
  );
200
- }
201
  }
202
  }
203
-
204
  // Page Templates
205
  $conditions['templates'] = array();
206
-
207
  $page_templates = get_page_templates();
208
-
209
  if ( count( $page_templates ) > 0 ) {
210
-
211
  $conditions_headings['templates'] = __( 'Page Templates', 'woosidebars' );
212
-
213
  foreach ( $page_templates as $k => $v ) {
214
  $token = str_replace( '.php', '', 'page-template-' . $v );
215
  $conditions['templates'][$token] = array(
216
- 'label' => $k,
217
  'description' => sprintf( __( 'The "%s" page template', 'woosidebars' ), $k )
218
  );
219
  }
220
  }
221
-
222
  // Post Type Archives
223
  $conditions['post_types'] = array();
224
-
225
  if ( count( $post_types ) > 0 ) {
226
-
227
  $conditions_headings['post_types'] = __( 'Post Types', 'woosidebars' );
228
-
229
  foreach ( $post_types as $k => $v ) {
230
  $token = 'post-type-archive-' . $k;
231
-
232
  if ( $v->has_archive ) {
233
  $conditions['post_types'][$token] = array(
234
- 'label' => sprintf( __( '"%s" Post Type Archive', 'woosidebars' ), $v->labels->name ),
235
  'description' => sprintf( __( 'The "%s" post type archive', 'woosidebars' ), $v->labels->name )
236
  );
237
  }
238
  }
239
-
240
  foreach ( $post_types as $k => $v ) {
241
  $token = 'post-type-' . $k;
242
  $conditions['post_types'][$token] = array(
243
- 'label' => sprintf( __( 'Each Individual %s', 'woosidebars' ), $v->labels->singular_name ),
244
  'description' => sprintf( __( 'Entries in the "%s" post type', 'woosidebars' ), $v->labels->name )
245
  );
246
  }
247
 
248
  }
249
-
250
  // Taxonomies and Taxonomy Terms
251
  $conditions['taxonomies'] = array();
252
-
253
  $args = array(
254
- 'public' => true,
255
- 'show_ui' => true
256
  );
257
-
258
  $taxonomies = get_taxonomies( $args, 'objects' );
259
-
260
  if ( count( $taxonomies ) > 0 ) {
261
-
262
  $conditions_headings['taxonomies'] = __( 'Taxonomy Archives', 'woosidebars' );
263
-
264
  foreach ( $taxonomies as $k => $v ) {
265
  $taxonomy = $v;
266
 
267
  if ( $taxonomy->public == true ) {
268
  $conditions['taxonomies']['archive-' . $k] = array(
269
- 'label' => $taxonomy->labels->name . ' (' . $k . ')',
270
  'description' => sprintf( __( 'The default "%s" archives', 'woosidebars' ), strtolower( $taxonomy->labels->name ) )
271
  );
272
-
273
  // Setup each individual taxonomy's terms as well.
274
  $conditions_headings['taxonomy-' . $k] = $taxonomy->labels->name;
275
  $terms = get_terms( $k );
276
  if ( count( $terms ) > 0 ) {
277
  $conditions['taxonomy-' . $k] = array();
278
  foreach ( $terms as $i => $j ) {
279
- $conditions['taxonomy-' . $k]['term-' . $j->term_id] = array( 'label' => $j->name, 'description' => sprintf( __( 'The %s %s archive', 'woosidebars' ), $j->name, strtolower( $taxonomy->labels->name ) ) );
280
  if ( $k == 'category' ) {
281
- $conditions['taxonomy-' . $k]['in-term-' . $j->term_id] = array( 'label' => sprintf( __( 'All posts in "%s"', 'woosidebars' ), $j->name ), 'description' => sprintf( __( 'All posts in the %s %s archive', 'woosidebars' ), $j->name, strtolower( $taxonomy->labels->name ) ) );
282
  }
283
  }
284
  }
285
-
286
  }
287
  }
288
  }
289
-
290
  $conditions_headings['hierarchy'] = __( 'Template Hierarchy', 'woosidebars' );
291
-
292
  // Template Hierarchy
293
  $conditions['hierarchy']['page'] = array(
294
  'label' => __( 'Pages', 'woosidebars' ),
295
  'description' => __( 'Displayed on all pages that don\'t have a more specific widget area.', 'woosidebars' )
296
  );
297
-
298
  $conditions['hierarchy']['search'] = array(
299
  'label' => __( 'Search Results', 'woosidebars' ),
300
  'description' => __( 'Displayed on search results screens.', 'woosidebars' )
301
  );
302
-
303
  $conditions['hierarchy']['home'] = array(
304
  'label' => __( 'Default "Your Latest Posts" Screen', 'woosidebars' ),
305
  'description' => __( 'Displayed on the default "Your Latest Posts" screen.', 'woosidebars' )
306
  );
307
-
308
  $conditions['hierarchy']['front_page'] = array(
309
  'label' => __( 'Front Page', 'woosidebars' ),
310
  'description' => __( 'Displayed on any front page, regardless of the settings under the "Settings -> Reading" admin screen.', 'woosidebars' )
311
  );
312
-
313
  $conditions['hierarchy']['single'] = array(
314
  'label' => __( 'Single Entries', 'woosidebars' ),
315
  'description' => __( 'Displayed on single entries of any public post type other than "Pages".', 'woosidebars' )
316
  );
317
-
318
  $conditions['hierarchy']['archive'] = array(
319
  'label' => __( 'All Archives', 'woosidebars' ),
320
  'description' => __( 'Displayed on all archives (category, tag, taxonomy, post type, dated, author and search).', 'woosidebars' )
321
  );
322
-
323
  $conditions['hierarchy']['author'] = array(
324
  'label' => __( 'Author Archives', 'woosidebars' ),
325
  'description' => __( 'Displayed on all author archive screens (that don\'t have a more specific sidebar).', 'woosidebars' )
326
  );
327
-
328
  $conditions['hierarchy']['date'] = array(
329
  'label' => __( 'Date Archives', 'woosidebars' ),
330
  'description' => __( 'Displayed on all date archives.', 'woosidebars' )
331
  );
332
-
333
  $conditions['hierarchy']['404'] = array(
334
  'label' => __( '404 Error Screens', 'woosidebars' ),
335
  'description' => __( 'Displayed on all 404 error screens.', 'woosidebars' )
@@ -338,11 +340,11 @@ class Woo_Conditions {
338
  $this->conditions_reference = (array)apply_filters( 'woo_conditions_reference', $conditions );
339
  $this->conditions_headings = (array)apply_filters( 'woo_conditions_headings', $conditions_headings );
340
  } // End setup_default_conditions_reference()
341
-
342
  /**
343
  * is_hierarchy function.
344
  *
345
- * @description Is the current view a part of the default template heirarchy?
346
  * @access public
347
  * @return void
348
  */
@@ -350,7 +352,7 @@ class Woo_Conditions {
350
  if ( is_front_page() && ! is_home() ) {
351
  $this->conditions[] = 'static_front_page';
352
  }
353
-
354
  if ( ! is_front_page() && is_home() ) {
355
  $this->conditions[] = 'inner_posts_page';
356
  }
@@ -362,9 +364,16 @@ class Woo_Conditions {
362
  if ( is_home() ) {
363
  $this->conditions[] = 'home';
364
  }
365
-
366
  if ( is_singular() ) {
367
  $this->conditions[] = 'singular';
 
 
 
 
 
 
 
368
  $this->conditions[] = 'post-type-' . get_post_type();
369
  $this->conditions[] = get_post_type();
370
 
@@ -378,36 +387,36 @@ class Woo_Conditions {
378
 
379
  $this->conditions[] = 'post' . '-' . get_the_ID();
380
  }
381
-
382
  if ( is_search() ) {
383
  $this->conditions[] = 'search';
384
  }
385
-
386
  if ( is_home() ) {
387
  $this->conditions[] = 'home';
388
  }
389
-
390
  if ( is_front_page() ) {
391
  $this->conditions[] = 'front_page';
392
  }
393
-
394
  if ( is_archive() ) {
395
  $this->conditions[] = 'archive';
396
  }
397
-
398
  if ( is_author() ) {
399
  $this->conditions[] = 'author';
400
  }
401
-
402
  if ( is_date() ) {
403
  $this->conditions[] = 'date';
404
  }
405
-
406
  if ( is_404() ) {
407
  $this->conditions[] = '404';
408
  }
409
  } // End is_hierarchy()
410
-
411
  /**
412
  * is_taxonomy function.
413
  *
@@ -422,11 +431,14 @@ class Woo_Conditions {
422
  if ( ! is_category() && ! is_tag() ) {
423
  $this->conditions[] = 'taxonomies';
424
  }
425
- $this->conditions[] = 'archive-' . $obj->taxonomy;
426
- $this->conditions[] = 'term-' . $obj->term_id;
 
 
 
427
  }
428
  } // End is_taxonomy()
429
-
430
  /**
431
  * is_post_type_archive function.
432
  *
@@ -439,7 +451,7 @@ class Woo_Conditions {
439
  $this->conditions[] = 'post-type-archive-' . get_post_type();
440
  }
441
  } // End is_post_type_archive()
442
-
443
  /**
444
  * is_page_template function.
445
  *
@@ -451,26 +463,26 @@ class Woo_Conditions {
451
  if ( is_singular() ) {
452
  global $post;
453
  $template = get_post_meta( $post->ID, '_wp_page_template', true );
454
-
455
  if ( $template != '' && $template != 'default' ) {
456
  $this->conditions[] = str_replace( '.php', '', 'page-template-' . $template );
457
  }
458
  }
459
  } // End is_page_template()
460
-
461
  /**
462
  * meta_box_setup function.
463
- *
464
  * @access public
465
  * @return void
466
  */
467
- public function meta_box_setup () {
468
- add_meta_box( 'woo-conditions', $this->meta_box_settings['title'], array( &$this, 'meta_box_content' ), $this->token, 'normal', 'low' );
469
  } // End meta_box_setup()
470
-
471
  /**
472
  * meta_box_content function.
473
- *
474
  * @access public
475
  * @return void
476
  */
@@ -478,7 +490,7 @@ class Woo_Conditions {
478
  global $post_id;
479
 
480
  if ( count( $this->conditions_reference ) <= 0 ) $this->setup_default_conditions_reference();
481
-
482
  $selected_conditions = get_post_meta( $post_id, '_condition', false );
483
 
484
  if ( $selected_conditions == '' ) {
@@ -486,25 +498,25 @@ class Woo_Conditions {
486
  }
487
 
488
  $html = '';
489
-
490
  $html .= '<input type="hidden" name="woo_' . $this->token . '_conditions_noonce" id="woo_' . $this->token . '_noonce" value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />';
491
-
492
  if ( count( $this->conditions_reference ) > 0 ) {
493
-
494
  // Separate out the taxonomy items for use as sub-tabs of "Taxonomy Terms".
495
  $taxonomy_terms = array();
496
-
497
  foreach ( $this->conditions_reference as $k => $v ) {
498
  if ( substr( $k, 0, 9 ) == 'taxonomy-' ) {
499
  $taxonomy_terms[$k] = $v;
500
  unset( $this->conditions_reference[$k] );
501
  }
502
  }
503
-
504
  $html .= '<div id="taxonomy-category" class="categorydiv tabs woo-conditions">' . "\n";
505
-
506
  $html .= '<ul id="category-tabs" class="conditions-tabs alignleft">' . "\n";
507
-
508
  $count = 0;
509
 
510
  // Determine whether or not to show advanced items, based on user's preference (default: false).
@@ -526,43 +538,43 @@ class Woo_Conditions {
526
  }
527
 
528
  if ( isset( $this->conditions_headings[$k] ) ) {
529
- $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-' . $k . '">' . $this->conditions_headings[$k] . '</a></li>' . "\n";
530
  }
531
 
532
  if ( $k == 'taxonomies' ) {
533
- $html .= '<li class="' . $class . '"><a href="#tab-taxonomy-terms">' . __( 'Taxonomy Terms', 'woosidebars' ) . '</a></li>' . "\n";
534
  }
535
  }
536
-
537
  $class = 'hide-if-no-js advanced';
538
  if ( ! $show_advanced ) { $class .= ' hide'; }
539
 
540
  $html .= '</ul>' . "\n";
541
 
542
  $html .= '<ul class="conditions-tabs"><li class="advanced-settings alignright hide-if-no-js"><a href="#">' . __( 'Advanced', 'woosidebars' ) . '</a></li></ul>' . "\n";
543
-
544
  foreach ( $this->conditions_reference as $k => $v ) {
545
  $count = 0;
546
-
547
  $tab = '';
548
 
549
- $tab .= '<div id="tab-' . $k . '" class="condition-tab">' . "\n";
550
- $tab .= '<h4>' . $this->conditions_headings[$k] . '</h4>' . "\n";
551
  $tab .= '<ul class="alignleft conditions-column">' . "\n";
552
  foreach ( $v as $i => $j ) {
553
  $count++;
554
-
555
  $checked = '';
556
  if ( in_array( $i, $selected_conditions ) ) {
557
  $checked = ' checked="checked"';
558
  }
559
- $tab .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . $i . '"' . $checked . ' /> ' . $j['label'] . '</label></li>' . "\n";
560
-
561
  if ( $count % 10 == 0 && $count < ( count( $v ) ) ) {
562
  $tab .= '</ul><ul class="alignleft conditions-column">';
563
  }
564
  }
565
-
566
  $tab .= '</ul>' . "\n";
567
  // Filter the contents of the current tab.
568
  $tab = apply_filters( 'woo_conditions_tab_' . esc_attr( $k ), $tab );
@@ -570,11 +582,11 @@ class Woo_Conditions {
570
  $html .= '<div class="clear"></div>';
571
  $html .= '</div>' . "\n";
572
  }
573
-
574
  // Taxonomy Terms Tab
575
  $html .= '<div id="tab-taxonomy-terms" class="condition-tab inner-tabs">' . "\n";
576
  $html .= '<ul class="conditions-tabs-inner hide-if-no-js">' . "\n";
577
-
578
  foreach ( $taxonomy_terms as $k => $v ) {
579
  if ( ! isset( $this->conditions_headings[$k] ) ) { unset( $taxonomy_terms[$k] ); }
580
  }
@@ -588,8 +600,8 @@ class Woo_Conditions {
588
  } else {
589
  $class = 'hide-if-no-js';
590
  }
591
-
592
- $html .= '<li><a href="#tab-' . $k . '" title="' . __( 'Taxonomy Token', 'woosidebars' ) . ': ' . str_replace( 'taxonomy-', '', $k ) . '">' . $this->conditions_headings[$k] . '</a>';
593
  if ( $count != count( $taxonomy_terms ) ) {
594
  $html .= ' |';
595
  }
@@ -597,80 +609,79 @@ class Woo_Conditions {
597
  }
598
 
599
  $html .= '</ul>' . "\n";
600
-
601
  foreach ( $taxonomy_terms as $k => $v ) {
602
  $count = 0;
603
-
604
  $html .= '<div id="tab-' . $k . '" class="condition-tab">' . "\n";
605
- $html .= '<h4>' . $this->conditions_headings[$k] . '</h4>' . "\n";
606
  $html .= '<ul class="alignleft conditions-column">' . "\n";
607
  foreach ( $v as $i => $j ) {
608
  $count++;
609
-
610
  $checked = '';
611
  if ( in_array( $i, $selected_conditions ) ) {
612
  $checked = ' checked="checked"';
613
  }
614
- $html .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . $i . '"' . $checked . ' /> ' . $j['label'] . '</label></li>' . "\n";
615
-
616
  if ( $count % 10 == 0 && $count < ( count( $v ) ) ) {
617
  $html .= '</ul><ul class="alignleft conditions-column">';
618
  }
619
  }
620
-
621
  $html .= '</ul>' . "\n";
622
  $html .= '<div class="clear"></div>';
623
  $html .= '</div>' . "\n";
624
  }
625
  $html .= '</div>' . "\n";
626
  }
627
-
628
  // Allow themes/plugins to act here (key, args).
629
  do_action( 'woo_conditions_meta_box', $k, $v );
630
 
631
  $html .= '<br class="clear" />' . "\n";
632
-
633
  echo $html;
634
  } // End meta_box_content()
635
-
636
  /**
637
  * meta_box_save function.
638
- *
639
  * @access public
640
  * @param mixed $post_id
641
  * @return void
642
  */
643
  public function meta_box_save ( $post_id ) {
644
  global $post, $messages;
645
-
646
  // Verify
647
- if ( ( get_post_type() != $this->token ) || ! wp_verify_nonce( $_POST['woo_' . $this->token . '_conditions_noonce'], plugin_basename(__FILE__) ) ) {
648
- return $post_id;
649
  }
650
-
651
- if ( 'page' == $_POST['post_type'] ) {
652
- if ( ! current_user_can( 'edit_page', $post_id ) ) {
653
  return $post_id;
654
  }
655
- } else {
656
- if ( ! current_user_can( 'edit_post', $post_id ) ) {
657
  return $post_id;
658
  }
659
  }
660
-
661
- if ( isset( $_POST['conditions'] ) && ( count( $_POST['conditions'] ) > 0 ) ) {
662
 
 
663
  delete_post_meta( $post_id, '_condition' );
664
-
665
  foreach ( $_POST['conditions'] as $k => $v ) {
666
- add_post_meta( $post_id, '_condition', $v, false );
667
  }
668
  }
669
  } // End meta_box_save()
670
 
671
  /**
672
  * show_advanced_itesm function.
673
- *
674
  * @access private
675
  * @return boolean
676
  */
@@ -686,19 +697,17 @@ class Woo_Conditions {
686
 
687
  /**
688
  * ajax_toggle_advanced_items function.
689
- *
690
  * @access public
691
  * @return void
692
  */
693
  public function ajax_toggle_advanced_items () {
694
- $nonce = $_POST['woosidebars_advanced_noonce'];
695
- $status = $_POST['new_status'];
696
  //Add nonce security to the request
697
- if ( ! wp_verify_nonce( $nonce, 'woosidebars_advanced_noonce' ) ) {
698
  die();
699
  }
700
 
701
- $response = set_user_setting( 'woosidebarsshowadvanced', $status );
702
 
703
  echo $response;
704
  die(); // WordPress may print out a spurious zero without this can be particularly bad if using JSON
@@ -706,23 +715,23 @@ class Woo_Conditions {
706
 
707
  /**
708
  * enqueue_scripts function.
709
- *
710
  * @access public
711
  * @return void
712
  */
713
  public function enqueue_scripts () {
714
  global $pagenow;
715
  if ( get_post_type() != $this->token ) { return; }
716
-
717
  if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
718
  wp_register_script( $this->token . '-admin', $this->assets_url . '/js/admin.js', array( 'jquery', 'jquery-ui-tabs' ), '1.2.1', true );
719
-
720
  wp_enqueue_script( $this->token . '-admin' );
721
-
722
  wp_dequeue_script( 'jquery-ui-datepicker' );
723
 
724
  $translation_strings = array();
725
-
726
  $ajax_vars = array( 'woosidebars_advanced_noonce' => wp_create_nonce( 'woosidebars_advanced_noonce' ) );
727
 
728
  $data = array_merge( $translation_strings, $ajax_vars );
18
  * public $conditions_headings
19
  * public $conditions_reference
20
  * public $meta_box_settings
21
+ * public $upper_limit
22
  * private $assets_url
23
  * private $plugin_url
24
  *
43
  public $conditions_headings = array();
44
  public $conditions_reference = array();
45
  public $meta_box_settings = array();
46
+ public $upper_limit;
47
  private $assets_url;
48
  private $plugin_url;
49
+
50
  /**
51
  * __construct function.
52
+ *
53
  * @access public
54
  * @return void
55
  */
56
  public function __construct () {
57
  $this->meta_box_settings['title'] = __( 'Conditions', 'woosidebars' );
58
+ $this->upper_limit = intval( apply_filters( 'woosidebars_upper_limit', 200 ) );
59
+
60
  if ( is_admin() && get_post_type() == $this->token || ! get_post_type() ) {
61
+ add_action( 'admin_menu', array( $this, 'meta_box_setup' ), 20 );
62
+ add_action( 'save_post', array( $this, 'meta_box_save' ) );
63
  }
64
+
65
  /* Plugin URL/path settings. */
66
  $this->plugin_url = str_replace( '/classes', '', plugins_url( plugin_basename( dirname( __FILE__ ) ) ) );
67
  $this->assets_url = $this->plugin_url . '/assets';
68
 
69
  if ( is_admin() ) {
70
+ add_action( 'admin_print_scripts', array( $this, 'enqueue_scripts' ), 12 );
71
  }
72
 
73
+ add_action( 'get_header', array( $this, 'get_conditions' ) );
74
 
75
+ add_action( 'wp_ajax_woosidebars-toggle-advanced-items', array( $this, 'ajax_toggle_advanced_items' ) );
76
  } // End __construct()
77
+
78
  /**
79
  * get_conditions function.
80
+ *
81
  * @access public
82
  * @return void
83
  */
88
 
89
  $this->conditions = array_reverse( $this->conditions );
90
  } // End get_conditions()
91
+
92
  /**
93
  * determine_conditions function.
94
+ *
95
  * @access public
96
  * @return void
97
  */
98
+ public function determine_conditions () {
99
  $this->is_hierarchy();
100
  $this->is_taxonomy();
101
  $this->is_post_type_archive();
102
+ $this->is_page_template();
103
  } // End determine_conditions()
104
+
105
  /**
106
  * setup_default_conditions_reference function.
107
  *
112
  public function setup_default_conditions_reference () {
113
  $conditions = array();
114
  $conditions_headings = array();
115
+
116
  // Get an array of the different post status labels, in case we need it later.
117
  $post_statuses = get_post_statuses();
118
 
119
  // Pages
120
  $conditions['pages'] = array();
121
+
122
  $statuses_string = join( ',', array_keys( $post_statuses ) );
123
  $pages = get_pages( array( 'post_status' => $statuses_string ) );
124
+
125
  if ( count( $pages ) > 0 ) {
126
+
127
  $conditions_headings['pages'] = __( 'Pages', 'woosidebars' );
128
+
129
  foreach ( $pages as $k => $v ) {
130
  $token = 'post-' . $v->ID;
131
+ $label = esc_html( $v->post_title );
132
  if ( 'publish' != $v->post_status ) {
133
+ $label .= ' (' . $post_statuses[$v->post_status] . ')';
134
  }
135
 
136
  $conditions['pages'][$token] = array(
137
+ 'label' => $label,
138
  'description' => sprintf( __( 'The "%s" page', 'woosidebars' ), $v->post_title )
139
  );
140
  }
141
 
142
  }
143
+
144
  $args = array(
145
  'show_ui' => true,
146
  'public' => true,
149
  );
150
 
151
  $post_types = get_post_types( $args, 'object' );
152
+
153
  // Set certain post types that aren't allowed to have custom sidebars.
154
  $disallowed_types = array( 'slide' );
155
 
156
  // Make the array filterable.
157
  $disallowed_types = apply_filters( 'woosidebars_disallowed_post_types', $disallowed_types );
158
+
159
  if ( count( $post_types ) ) {
160
  foreach ( $post_types as $k => $v ) {
161
  if ( in_array( $k, $disallowed_types ) ) {
163
  }
164
  }
165
  }
166
+
167
  // Add per-post support for any post type that supports it.
168
  $args = array(
169
  'show_ui' => true,
173
  );
174
 
175
  $built_in_post_types = get_post_types( $args, 'object' );
176
+
177
  foreach ( $built_in_post_types as $k => $v ) {
178
  if ( $k == 'post' ) {
179
  $post_types[$k] = $v;
183
 
184
  foreach ( $post_types as $k => $v ) {
185
  if ( ! post_type_supports( $k, 'woosidebars' ) ) { continue; }
186
+
187
  $conditions_headings[$k] = $v->labels->name;
188
+
189
+ $query_args = array( 'numberposts' => intval( $this->upper_limit ), 'post_type' => $k, 'meta_key' => '_enable_sidebar', 'meta_value' => 'yes', 'meta_compare' => '=', 'post_status' => 'any', 'suppress_filters' => 'false' );
190
+
191
  $posts = get_posts( $query_args );
192
+
193
  if ( count( $posts ) > 0 ) {
194
  foreach ( $posts as $i => $j ) {
195
  $label = $j->post_title;
197
  $label .= ' <strong>(' . $post_statuses[$j->post_status] . ')</strong>';
198
  }
199
  $conditions[$k]['post' . '-' . $j->ID] = array(
200
+ 'label' => $label,
201
  'description' => sprintf( __( 'A custom sidebar for "%s"', 'woosidebars' ), esc_attr( $j->post_title ) )
202
  );
203
+ }
204
  }
205
  }
206
+
207
  // Page Templates
208
  $conditions['templates'] = array();
209
+
210
  $page_templates = get_page_templates();
211
+
212
  if ( count( $page_templates ) > 0 ) {
213
+
214
  $conditions_headings['templates'] = __( 'Page Templates', 'woosidebars' );
215
+
216
  foreach ( $page_templates as $k => $v ) {
217
  $token = str_replace( '.php', '', 'page-template-' . $v );
218
  $conditions['templates'][$token] = array(
219
+ 'label' => $k,
220
  'description' => sprintf( __( 'The "%s" page template', 'woosidebars' ), $k )
221
  );
222
  }
223
  }
224
+
225
  // Post Type Archives
226
  $conditions['post_types'] = array();
227
+
228
  if ( count( $post_types ) > 0 ) {
229
+
230
  $conditions_headings['post_types'] = __( 'Post Types', 'woosidebars' );
231
+
232
  foreach ( $post_types as $k => $v ) {
233
  $token = 'post-type-archive-' . $k;
234
+
235
  if ( $v->has_archive ) {
236
  $conditions['post_types'][$token] = array(
237
+ 'label' => sprintf( __( '"%s" Post Type Archive', 'woosidebars' ), $v->labels->name ),
238
  'description' => sprintf( __( 'The "%s" post type archive', 'woosidebars' ), $v->labels->name )
239
  );
240
  }
241
  }
242
+
243
  foreach ( $post_types as $k => $v ) {
244
  $token = 'post-type-' . $k;
245
  $conditions['post_types'][$token] = array(
246
+ 'label' => sprintf( __( 'Each Individual %s', 'woosidebars' ), $v->labels->singular_name ),
247
  'description' => sprintf( __( 'Entries in the "%s" post type', 'woosidebars' ), $v->labels->name )
248
  );
249
  }
250
 
251
  }
252
+
253
  // Taxonomies and Taxonomy Terms
254
  $conditions['taxonomies'] = array();
255
+
256
  $args = array(
257
+ 'public' => true
 
258
  );
259
+
260
  $taxonomies = get_taxonomies( $args, 'objects' );
261
+
262
  if ( count( $taxonomies ) > 0 ) {
263
+
264
  $conditions_headings['taxonomies'] = __( 'Taxonomy Archives', 'woosidebars' );
265
+
266
  foreach ( $taxonomies as $k => $v ) {
267
  $taxonomy = $v;
268
 
269
  if ( $taxonomy->public == true ) {
270
  $conditions['taxonomies']['archive-' . $k] = array(
271
+ 'label' => esc_html( $taxonomy->labels->name ) . ' (' . esc_html( $k ) . ')',
272
  'description' => sprintf( __( 'The default "%s" archives', 'woosidebars' ), strtolower( $taxonomy->labels->name ) )
273
  );
274
+
275
  // Setup each individual taxonomy's terms as well.
276
  $conditions_headings['taxonomy-' . $k] = $taxonomy->labels->name;
277
  $terms = get_terms( $k );
278
  if ( count( $terms ) > 0 ) {
279
  $conditions['taxonomy-' . $k] = array();
280
  foreach ( $terms as $i => $j ) {
281
+ $conditions['taxonomy-' . $k]['term-' . $j->term_id] = array( 'label' => esc_html( $j->name ), 'description' => sprintf( __( 'The %s %s archive', 'woosidebars' ), esc_html( $j->name ), strtolower( $taxonomy->labels->name ) ) );
282
  if ( $k == 'category' ) {
283
+ $conditions['taxonomy-' . $k]['in-term-' . $j->term_id] = array( 'label' => sprintf( __( 'All posts in "%s"', 'woosidebars' ), esc_html( $j->name ) ), 'description' => sprintf( __( 'All posts in the %s %s archive', 'woosidebars' ), esc_html( $j->name ), strtolower( $taxonomy->labels->name ) ) );
284
  }
285
  }
286
  }
287
+
288
  }
289
  }
290
  }
291
+
292
  $conditions_headings['hierarchy'] = __( 'Template Hierarchy', 'woosidebars' );
293
+
294
  // Template Hierarchy
295
  $conditions['hierarchy']['page'] = array(
296
  'label' => __( 'Pages', 'woosidebars' ),
297
  'description' => __( 'Displayed on all pages that don\'t have a more specific widget area.', 'woosidebars' )
298
  );
299
+
300
  $conditions['hierarchy']['search'] = array(
301
  'label' => __( 'Search Results', 'woosidebars' ),
302
  'description' => __( 'Displayed on search results screens.', 'woosidebars' )
303
  );
304
+
305
  $conditions['hierarchy']['home'] = array(
306
  'label' => __( 'Default "Your Latest Posts" Screen', 'woosidebars' ),
307
  'description' => __( 'Displayed on the default "Your Latest Posts" screen.', 'woosidebars' )
308
  );
309
+
310
  $conditions['hierarchy']['front_page'] = array(
311
  'label' => __( 'Front Page', 'woosidebars' ),
312
  'description' => __( 'Displayed on any front page, regardless of the settings under the "Settings -> Reading" admin screen.', 'woosidebars' )
313
  );
314
+
315
  $conditions['hierarchy']['single'] = array(
316
  'label' => __( 'Single Entries', 'woosidebars' ),
317
  'description' => __( 'Displayed on single entries of any public post type other than "Pages".', 'woosidebars' )
318
  );
319
+
320
  $conditions['hierarchy']['archive'] = array(
321
  'label' => __( 'All Archives', 'woosidebars' ),
322
  'description' => __( 'Displayed on all archives (category, tag, taxonomy, post type, dated, author and search).', 'woosidebars' )
323
  );
324
+
325
  $conditions['hierarchy']['author'] = array(
326
  'label' => __( 'Author Archives', 'woosidebars' ),
327
  'description' => __( 'Displayed on all author archive screens (that don\'t have a more specific sidebar).', 'woosidebars' )
328
  );
329
+
330
  $conditions['hierarchy']['date'] = array(
331
  'label' => __( 'Date Archives', 'woosidebars' ),
332
  'description' => __( 'Displayed on all date archives.', 'woosidebars' )
333
  );
334
+
335
  $conditions['hierarchy']['404'] = array(
336
  'label' => __( '404 Error Screens', 'woosidebars' ),
337
  'description' => __( 'Displayed on all 404 error screens.', 'woosidebars' )
340
  $this->conditions_reference = (array)apply_filters( 'woo_conditions_reference', $conditions );
341
  $this->conditions_headings = (array)apply_filters( 'woo_conditions_headings', $conditions_headings );
342
  } // End setup_default_conditions_reference()
343
+
344
  /**
345
  * is_hierarchy function.
346
  *
347
+ * @description Is the current view a part of the default template heirarchy?
348
  * @access public
349
  * @return void
350
  */
352
  if ( is_front_page() && ! is_home() ) {
353
  $this->conditions[] = 'static_front_page';
354
  }
355
+
356
  if ( ! is_front_page() && is_home() ) {
357
  $this->conditions[] = 'inner_posts_page';
358
  }
364
  if ( is_home() ) {
365
  $this->conditions[] = 'home';
366
  }
367
+
368
  if ( is_singular() ) {
369
  $this->conditions[] = 'singular';
370
+ }
371
+
372
+ if ( is_single() ) {
373
+ $this->conditions[] = 'single';
374
+ }
375
+
376
+ if ( is_single() || is_singular() ) {
377
  $this->conditions[] = 'post-type-' . get_post_type();
378
  $this->conditions[] = get_post_type();
379
 
387
 
388
  $this->conditions[] = 'post' . '-' . get_the_ID();
389
  }
390
+
391
  if ( is_search() ) {
392
  $this->conditions[] = 'search';
393
  }
394
+
395
  if ( is_home() ) {
396
  $this->conditions[] = 'home';
397
  }
398
+
399
  if ( is_front_page() ) {
400
  $this->conditions[] = 'front_page';
401
  }
402
+
403
  if ( is_archive() ) {
404
  $this->conditions[] = 'archive';
405
  }
406
+
407
  if ( is_author() ) {
408
  $this->conditions[] = 'author';
409
  }
410
+
411
  if ( is_date() ) {
412
  $this->conditions[] = 'date';
413
  }
414
+
415
  if ( is_404() ) {
416
  $this->conditions[] = '404';
417
  }
418
  } // End is_hierarchy()
419
+
420
  /**
421
  * is_taxonomy function.
422
  *
431
  if ( ! is_category() && ! is_tag() ) {
432
  $this->conditions[] = 'taxonomies';
433
  }
434
+
435
+ if ( is_object( $obj ) ) {
436
+ $this->conditions[] = 'archive-' . $obj->taxonomy;
437
+ $this->conditions[] = 'term-' . $obj->term_id;
438
+ }
439
  }
440
  } // End is_taxonomy()
441
+
442
  /**
443
  * is_post_type_archive function.
444
  *
451
  $this->conditions[] = 'post-type-archive-' . get_post_type();
452
  }
453
  } // End is_post_type_archive()
454
+
455
  /**
456
  * is_page_template function.
457
  *
463
  if ( is_singular() ) {
464
  global $post;
465
  $template = get_post_meta( $post->ID, '_wp_page_template', true );
466
+
467
  if ( $template != '' && $template != 'default' ) {
468
  $this->conditions[] = str_replace( '.php', '', 'page-template-' . $template );
469
  }
470
  }
471
  } // End is_page_template()
472
+
473
  /**
474
  * meta_box_setup function.
475
+ *
476
  * @access public
477
  * @return void
478
  */
479
+ public function meta_box_setup () {
480
+ add_meta_box( 'woosidebars-conditions', esc_html( $this->meta_box_settings['title'] ), array( $this, 'meta_box_content' ), $this->token, 'normal', 'low' );
481
  } // End meta_box_setup()
482
+
483
  /**
484
  * meta_box_content function.
485
+ *
486
  * @access public
487
  * @return void
488
  */
490
  global $post_id;
491
 
492
  if ( count( $this->conditions_reference ) <= 0 ) $this->setup_default_conditions_reference();
493
+
494
  $selected_conditions = get_post_meta( $post_id, '_condition', false );
495
 
496
  if ( $selected_conditions == '' ) {
498
  }
499
 
500
  $html = '';
501
+
502
  $html .= '<input type="hidden" name="woo_' . $this->token . '_conditions_noonce" id="woo_' . $this->token . '_noonce" value="' . wp_create_nonce( plugin_basename(__FILE__) ) . '" />';
503
+
504
  if ( count( $this->conditions_reference ) > 0 ) {
505
+
506
  // Separate out the taxonomy items for use as sub-tabs of "Taxonomy Terms".
507
  $taxonomy_terms = array();
508
+
509
  foreach ( $this->conditions_reference as $k => $v ) {
510
  if ( substr( $k, 0, 9 ) == 'taxonomy-' ) {
511
  $taxonomy_terms[$k] = $v;
512
  unset( $this->conditions_reference[$k] );
513
  }
514
  }
515
+
516
  $html .= '<div id="taxonomy-category" class="categorydiv tabs woo-conditions">' . "\n";
517
+
518
  $html .= '<ul id="category-tabs" class="conditions-tabs alignleft">' . "\n";
519
+
520
  $count = 0;
521
 
522
  // Determine whether or not to show advanced items, based on user's preference (default: false).
538
  }
539
 
540
  if ( isset( $this->conditions_headings[$k] ) ) {
541
+ $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-' . esc_attr( $k ) . '">' . esc_html( $this->conditions_headings[$k] ) . '</a></li>' . "\n";
542
  }
543
 
544
  if ( $k == 'taxonomies' ) {
545
+ $html .= '<li class="' . esc_attr( $class ) . '"><a href="#tab-taxonomy-terms">' . __( 'Taxonomy Terms', 'woosidebars' ) . '</a></li>' . "\n";
546
  }
547
  }
548
+
549
  $class = 'hide-if-no-js advanced';
550
  if ( ! $show_advanced ) { $class .= ' hide'; }
551
 
552
  $html .= '</ul>' . "\n";
553
 
554
  $html .= '<ul class="conditions-tabs"><li class="advanced-settings alignright hide-if-no-js"><a href="#">' . __( 'Advanced', 'woosidebars' ) . '</a></li></ul>' . "\n";
555
+
556
  foreach ( $this->conditions_reference as $k => $v ) {
557
  $count = 0;
558
+
559
  $tab = '';
560
 
561
+ $tab .= '<div id="tab-' . esc_attr( $k ) . '" class="condition-tab">' . "\n";
562
+ $tab .= '<h4>' . esc_html( $this->conditions_headings[$k] ) . '</h4>' . "\n";
563
  $tab .= '<ul class="alignleft conditions-column">' . "\n";
564
  foreach ( $v as $i => $j ) {
565
  $count++;
566
+
567
  $checked = '';
568
  if ( in_array( $i, $selected_conditions ) ) {
569
  $checked = ' checked="checked"';
570
  }
571
+ $tab .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . $i . '"' . $checked . ' /> ' . esc_html( $j['label'] ) . '</label></li>' . "\n";
572
+
573
  if ( $count % 10 == 0 && $count < ( count( $v ) ) ) {
574
  $tab .= '</ul><ul class="alignleft conditions-column">';
575
  }
576
  }
577
+
578
  $tab .= '</ul>' . "\n";
579
  // Filter the contents of the current tab.
580
  $tab = apply_filters( 'woo_conditions_tab_' . esc_attr( $k ), $tab );
582
  $html .= '<div class="clear"></div>';
583
  $html .= '</div>' . "\n";
584
  }
585
+
586
  // Taxonomy Terms Tab
587
  $html .= '<div id="tab-taxonomy-terms" class="condition-tab inner-tabs">' . "\n";
588
  $html .= '<ul class="conditions-tabs-inner hide-if-no-js">' . "\n";
589
+
590
  foreach ( $taxonomy_terms as $k => $v ) {
591
  if ( ! isset( $this->conditions_headings[$k] ) ) { unset( $taxonomy_terms[$k] ); }
592
  }
600
  } else {
601
  $class = 'hide-if-no-js';
602
  }
603
+
604
+ $html .= '<li><a href="#tab-' . $k . '" title="' . __( 'Taxonomy Token', 'woosidebars' ) . ': ' . str_replace( 'taxonomy-', '', $k ) . '">' . esc_html( $this->conditions_headings[$k] ) . '</a>';
605
  if ( $count != count( $taxonomy_terms ) ) {
606
  $html .= ' |';
607
  }
609
  }
610
 
611
  $html .= '</ul>' . "\n";
612
+
613
  foreach ( $taxonomy_terms as $k => $v ) {
614
  $count = 0;
615
+
616
  $html .= '<div id="tab-' . $k . '" class="condition-tab">' . "\n";
617
+ $html .= '<h4>' . esc_html( $this->conditions_headings[$k] ) . '</h4>' . "\n";
618
  $html .= '<ul class="alignleft conditions-column">' . "\n";
619
  foreach ( $v as $i => $j ) {
620
  $count++;
621
+
622
  $checked = '';
623
  if ( in_array( $i, $selected_conditions ) ) {
624
  $checked = ' checked="checked"';
625
  }
626
+ $html .= '<li><label class="selectit" title="' . esc_attr( $j['description'] ) . '"><input type="checkbox" name="conditions[]" value="' . $i . '" id="checkbox-' . esc_attr( $i ) . '"' . $checked . ' /> ' . esc_html( $j['label'] ) . '</label></li>' . "\n";
627
+
628
  if ( $count % 10 == 0 && $count < ( count( $v ) ) ) {
629
  $html .= '</ul><ul class="alignleft conditions-column">';
630
  }
631
  }
632
+
633
  $html .= '</ul>' . "\n";
634
  $html .= '<div class="clear"></div>';
635
  $html .= '</div>' . "\n";
636
  }
637
  $html .= '</div>' . "\n";
638
  }
639
+
640
  // Allow themes/plugins to act here (key, args).
641
  do_action( 'woo_conditions_meta_box', $k, $v );
642
 
643
  $html .= '<br class="clear" />' . "\n";
644
+
645
  echo $html;
646
  } // End meta_box_content()
647
+
648
  /**
649
  * meta_box_save function.
650
+ *
651
  * @access public
652
  * @param mixed $post_id
653
  * @return void
654
  */
655
  public function meta_box_save ( $post_id ) {
656
  global $post, $messages;
657
+
658
  // Verify
659
+ if ( ! isset( $_POST['woo_' . $this->token . '_conditions_noonce'] ) || ( get_post_type() != $this->token ) || ! wp_verify_nonce( $_POST['woo_' . $this->token . '_conditions_noonce'], plugin_basename(__FILE__) ) ) {
660
+ return $post_id;
661
  }
662
+
663
+ if ( 'page' == $_POST['post_type'] ) {
664
+ if ( ! current_user_can( 'edit_page', $post_id ) ) {
665
  return $post_id;
666
  }
667
+ } else {
668
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
669
  return $post_id;
670
  }
671
  }
 
 
672
 
673
+ if ( isset( $_POST['conditions'] ) && ( count( $_POST['conditions'] ) > 0 ) ) {
674
  delete_post_meta( $post_id, '_condition' );
675
+
676
  foreach ( $_POST['conditions'] as $k => $v ) {
677
+ update_post_meta( $post_id, '_condition', $v, false );
678
  }
679
  }
680
  } // End meta_box_save()
681
 
682
  /**
683
  * show_advanced_itesm function.
684
+ *
685
  * @access private
686
  * @return boolean
687
  */
697
 
698
  /**
699
  * ajax_toggle_advanced_items function.
700
+ *
701
  * @access public
702
  * @return void
703
  */
704
  public function ajax_toggle_advanced_items () {
 
 
705
  //Add nonce security to the request
706
+ if ( ( ! isset( $_POST['woosidebars_advanced_noonce'] ) || ! isset( $_POST['new_status'] ) ) || ! wp_verify_nonce( $_POST['woosidebars_advanced_noonce'], 'woosidebars_advanced_noonce' ) ) {
707
  die();
708
  }
709
 
710
+ $response = set_user_setting( 'woosidebarsshowadvanced', $_POST['new_status'] );
711
 
712
  echo $response;
713
  die(); // WordPress may print out a spurious zero without this can be particularly bad if using JSON
715
 
716
  /**
717
  * enqueue_scripts function.
718
+ *
719
  * @access public
720
  * @return void
721
  */
722
  public function enqueue_scripts () {
723
  global $pagenow;
724
  if ( get_post_type() != $this->token ) { return; }
725
+
726
  if ( in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
727
  wp_register_script( $this->token . '-admin', $this->assets_url . '/js/admin.js', array( 'jquery', 'jquery-ui-tabs' ), '1.2.1', true );
728
+
729
  wp_enqueue_script( $this->token . '-admin' );
730
+
731
  wp_dequeue_script( 'jquery-ui-datepicker' );
732
 
733
  $translation_strings = array();
734
+
735
  $ajax_vars = array( 'woosidebars_advanced_noonce' => wp_create_nonce( 'woosidebars_advanced_noonce' ) );
736
 
737
  $data = array_merge( $translation_strings, $ajax_vars );
classes/class-woo-sidebars.php CHANGED
@@ -15,6 +15,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
  *
16
  * public $version
17
  * private $file
 
18
  *
19
  * private $token
20
  * private $prefix
@@ -54,6 +55,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
54
  class Woo_Sidebars {
55
  public $version;
56
  private $file;
 
57
 
58
  private $token;
59
  private $prefix;
@@ -71,6 +73,7 @@ class Woo_Sidebars {
71
  public function __construct ( $file ) {
72
  $this->version = '';
73
  $this->file = $file;
 
74
 
75
  $this->token = 'sidebar';
76
  $this->prefix = 'woo_sidebar_';
@@ -90,36 +93,36 @@ class Woo_Sidebars {
90
  * @return void
91
  */
92
  public function init () {
93
- add_action( 'init', array( &$this, 'load_localisation' ) );
94
 
95
- add_action( 'init', array( &$this, 'register_post_type' ), 20 );
96
- add_action( 'admin_menu', array( &$this, 'meta_box_setup' ), 20 );
97
- add_action( 'save_post', array( &$this, 'meta_box_save' ) );
98
- add_filter( 'enter_title_here', array( &$this, 'enter_title_here' ) );
99
- add_filter( 'post_updated_messages', array( &$this, 'update_messages' ) );
100
- add_action( 'widgets_init', array( &$this, 'register_custom_sidebars' ) );
101
- add_action( 'get_header', array( &$this, 'init_sidebar_replacement' ) );
102
 
103
  if ( is_admin() ) {
104
  global $pagenow;
105
 
106
- add_action( 'admin_print_styles', array( &$this, 'enqueue_styles' ), 12 );
107
  add_action( 'admin_head', array( $this, 'add_contextual_help' ) );
108
  if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
109
- add_filter( 'manage_edit-' . $this->token . '_columns', array( &$this, 'register_custom_column_headings' ), 10, 1 );
110
- add_action( 'manage_posts_custom_column', array( &$this, 'register_custom_columns' ), 10, 2 );
111
  }
112
  }
113
 
114
  // By default, add post type support for sidebars to the "post" post type.
115
  add_post_type_support( 'post', 'woosidebars' );
116
 
117
- add_action( 'admin_head', array( &$this, 'register_post_type_columns' ) );
118
 
119
- add_action( 'wp_ajax_woosidebars-post-enable', array( &$this, 'enable_custom_post_sidebars' ) );
120
 
121
  // Run this on activation.
122
- register_activation_hook( $this->file, array( &$this, 'activation' ) );
123
  } // End init()
124
 
125
  /**
@@ -132,9 +135,9 @@ class Woo_Sidebars {
132
  $post_type = get_post_type();
133
 
134
  if ( $post_type != '' && post_type_supports( $post_type, 'woosidebars' ) ) {
135
- add_filter( 'manage_edit-' . $post_type . '_columns', array( &$this, 'add_post_column_headings' ), 10, 1 );
136
- add_action( 'manage_posts_custom_column', array( &$this, 'add_post_column_data' ), 10, 2 );
137
- add_action( 'manage_pages_custom_column', array( &$this, 'add_post_column_data' ), 10, 2 );
138
  }
139
  } // End register_post_type_columns()
140
 
@@ -284,14 +287,14 @@ class Woo_Sidebars {
284
  * @return void
285
  */
286
  public function meta_box_setup () {
287
- add_meta_box( 'sidebar-to-replace', __( 'Sidebar To Replace', 'woosidebars' ), array( &$this, 'meta_box_content' ), $this->token, 'side', 'low' );
288
 
289
  // Remove "Custom Settings" meta box.
290
  remove_meta_box( 'woothemes-settings', 'sidebar', 'normal' );
291
 
292
  // Customise the "Excerpt" meta box for the sidebars.
293
  remove_meta_box( 'postexcerpt', $this->token, 'normal' );
294
- add_meta_box( 'sidebar-description', __( 'Description', 'woosidebars' ), array( &$this, 'description_meta_box' ), $this->token, 'normal', 'core' );
295
  } // End meta_box_setup()
296
 
297
  /**
@@ -421,7 +424,7 @@ class Woo_Sidebars {
421
  $sidebars = array();
422
  $to_ignore = array();
423
 
424
- $custom_sidebars = get_posts( 'post_type=sidebar&numberposts=-1' );
425
  if ( ! is_wp_error( $custom_sidebars ) && count( $custom_sidebars ) > 0 ) {
426
  foreach ( $custom_sidebars as $k => $v ) {
427
  $to_ignore[] = $v->post_name;
@@ -446,7 +449,7 @@ class Woo_Sidebars {
446
  * @return void
447
  */
448
  public function register_custom_sidebars () {
449
- $sidebars = get_posts( array( 'post_type' => 'sidebar', 'posts_per_page' => -1 ) );
450
 
451
  if ( count( $sidebars ) > 0 ) {
452
  foreach ( $sidebars as $k => $v ) {
@@ -464,7 +467,7 @@ class Woo_Sidebars {
464
  * @return void
465
  */
466
  public function init_sidebar_replacement () {
467
- add_filter( 'sidebars_widgets', array( &$this, 'replace_sidebars' ) );
468
  } // End init_sidebar_replacement()
469
 
470
  /**
@@ -494,7 +497,8 @@ class Woo_Sidebars {
494
 
495
  $args = array(
496
  'post_type' => $this->token,
497
- 'posts_per_page' => -1
 
498
  );
499
 
500
  $meta_query = array(
@@ -662,7 +666,7 @@ class Woo_Sidebars {
662
  }
663
 
664
  $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woosidebars-post-enable&post_id=' . $post->ID ), 'woosidebars-post-enable' );
665
- $value = '<span class="' . esc_attr( $class ) . '"><a href="' . esc_url( $url ) . '"><img src="' . $this->assets_url . '/images/' . $image . '.png" /></a></span>';
666
 
667
  echo $value;
668
  break;
@@ -761,7 +765,7 @@ class Woo_Sidebars {
761
  get_current_screen()->set_help_sidebar(
762
  '<p><strong>' . __( 'For more information:', 'woosidebars' ) . '</strong></p>' .
763
  '<p><a href="http://support.woothemes.com/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'Support HelpDesk', 'woosidebars' ) . '</a></p>' .
764
- '<p><a href="http://dojodocs.woothemes.com/woosidebars/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'WooSidebars Documentation', 'woosidebars' ) . '</a></p>'
765
  );
766
  } // End add_contextual_help()
767
 
@@ -773,7 +777,7 @@ class Woo_Sidebars {
773
  * @return void
774
  */
775
  public function load_localisation () {
776
- $lang_dir = trailingslashit( str_replace( 'classes', 'lang', basename( dirname(__FILE__) ) ) );
777
  load_plugin_textdomain( 'woosidebars', false, $lang_dir );
778
  } // End load_localisation()
779
 
15
  *
16
  * public $version
17
  * private $file
18
+ * public $upper_limit
19
  *
20
  * private $token
21
  * private $prefix
55
  class Woo_Sidebars {
56
  public $version;
57
  private $file;
58
+ public $upper_limit;
59
 
60
  private $token;
61
  private $prefix;
73
  public function __construct ( $file ) {
74
  $this->version = '';
75
  $this->file = $file;
76
+ $this->upper_limit = intval( apply_filters( 'woosidebars_upper_limit', 200 ) );
77
 
78
  $this->token = 'sidebar';
79
  $this->prefix = 'woo_sidebar_';
93
  * @return void
94
  */
95
  public function init () {
96
+ add_action( 'init', array( $this, 'load_localisation' ) );
97
 
98
+ add_action( 'init', array( $this, 'register_post_type' ), 20 );
99
+ add_action( 'admin_menu', array( $this, 'meta_box_setup' ), 20 );
100
+ add_action( 'save_post', array( $this, 'meta_box_save' ) );
101
+ add_filter( 'enter_title_here', array( $this, 'enter_title_here' ) );
102
+ add_filter( 'post_updated_messages', array( $this, 'update_messages' ) );
103
+ add_action( 'widgets_init', array( $this, 'register_custom_sidebars' ) );
104
+ add_action( 'get_header', array( $this, 'init_sidebar_replacement' ) );
105
 
106
  if ( is_admin() ) {
107
  global $pagenow;
108
 
109
+ add_action( 'admin_print_styles', array( $this, 'enqueue_styles' ), 12 );
110
  add_action( 'admin_head', array( $this, 'add_contextual_help' ) );
111
  if ( $pagenow == 'edit.php' && isset( $_GET['post_type'] ) && esc_attr( $_GET['post_type'] ) == $this->token ) {
112
+ add_filter( 'manage_edit-' . $this->token . '_columns', array( $this, 'register_custom_column_headings' ), 10, 1 );
113
+ add_action( 'manage_posts_custom_column', array( $this, 'register_custom_columns' ), 10, 2 );
114
  }
115
  }
116
 
117
  // By default, add post type support for sidebars to the "post" post type.
118
  add_post_type_support( 'post', 'woosidebars' );
119
 
120
+ add_action( 'admin_head', array( $this, 'register_post_type_columns' ) );
121
 
122
+ add_action( 'wp_ajax_woosidebars-post-enable', array( $this, 'enable_custom_post_sidebars' ) );
123
 
124
  // Run this on activation.
125
+ register_activation_hook( $this->file, array( $this, 'activation' ) );
126
  } // End init()
127
 
128
  /**
135
  $post_type = get_post_type();
136
 
137
  if ( $post_type != '' && post_type_supports( $post_type, 'woosidebars' ) ) {
138
+ add_filter( 'manage_edit-' . $post_type . '_columns', array( $this, 'add_post_column_headings' ), 10, 1 );
139
+ add_action( 'manage_posts_custom_column', array( $this, 'add_post_column_data' ), 10, 2 );
140
+ add_action( 'manage_pages_custom_column', array( $this, 'add_post_column_data' ), 10, 2 );
141
  }
142
  } // End register_post_type_columns()
143
 
287
  * @return void
288
  */
289
  public function meta_box_setup () {
290
+ add_meta_box( 'sidebar-to-replace', __( 'Sidebar To Replace', 'woosidebars' ), array( $this, 'meta_box_content' ), $this->token, 'side', 'low' );
291
 
292
  // Remove "Custom Settings" meta box.
293
  remove_meta_box( 'woothemes-settings', 'sidebar', 'normal' );
294
 
295
  // Customise the "Excerpt" meta box for the sidebars.
296
  remove_meta_box( 'postexcerpt', $this->token, 'normal' );
297
+ add_meta_box( 'sidebar-description', __( 'Description', 'woosidebars' ), array( $this, 'description_meta_box' ), $this->token, 'normal', 'core' );
298
  } // End meta_box_setup()
299
 
300
  /**
424
  $sidebars = array();
425
  $to_ignore = array();
426
 
427
+ $custom_sidebars = get_posts( array( 'post_type' => 'sidebar', 'numberposts' => intval( $this->upper_limit ), 'suppress_filters' => 'false' ) );
428
  if ( ! is_wp_error( $custom_sidebars ) && count( $custom_sidebars ) > 0 ) {
429
  foreach ( $custom_sidebars as $k => $v ) {
430
  $to_ignore[] = $v->post_name;
449
  * @return void
450
  */
451
  public function register_custom_sidebars () {
452
+ $sidebars = get_posts( array( 'post_type' => 'sidebar', 'posts_per_page' => intval( $this->upper_limit ), 'suppress_filters' => 'false' ) );
453
 
454
  if ( count( $sidebars ) > 0 ) {
455
  foreach ( $sidebars as $k => $v ) {
467
  * @return void
468
  */
469
  public function init_sidebar_replacement () {
470
+ add_filter( 'sidebars_widgets', array( $this, 'replace_sidebars' ) );
471
  } // End init_sidebar_replacement()
472
 
473
  /**
497
 
498
  $args = array(
499
  'post_type' => $this->token,
500
+ 'posts_per_page' => intval( $this->upper_limit ),
501
+ 'suppress_filters' => 'false'
502
  );
503
 
504
  $meta_query = array(
666
  }
667
 
668
  $url = wp_nonce_url( admin_url( 'admin-ajax.php?action=woosidebars-post-enable&post_id=' . $post->ID ), 'woosidebars-post-enable' );
669
+ $value = '<span class="' . esc_attr( $class ) . '"><a href="' . esc_url( $url ) . '"><img src="' . esc_url( $this->assets_url . '/images/' . $image . '.png' ) . '" /></a></span>';
670
 
671
  echo $value;
672
  break;
765
  get_current_screen()->set_help_sidebar(
766
  '<p><strong>' . __( 'For more information:', 'woosidebars' ) . '</strong></p>' .
767
  '<p><a href="http://support.woothemes.com/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'Support HelpDesk', 'woosidebars' ) . '</a></p>' .
768
+ '<p><a href="http://docs.woothemes.com/document/woosidebars/?ref=' . 'woosidebars' . '" target="_blank">' . __( 'WooSidebars Documentation', 'woosidebars' ) . '</a></p>'
769
  );
770
  } // End add_contextual_help()
771
 
777
  * @return void
778
  */
779
  public function load_localisation () {
780
+ $lang_dir = trailingslashit( str_replace( 'classes', 'lang', plugin_basename( dirname(__FILE__) ) ) );
781
  load_plugin_textdomain( 'woosidebars', false, $lang_dir );
782
  } // End load_localisation()
783
 
lang/woosidebars-en_GB.po CHANGED
@@ -1,15 +1,16 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: WooSidebars v1.1.2\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
- "PO-Revision-Date: 2012-08-14 10:26:15+0000\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
13
  "X-Poedit-Language: \n"
14
  "X-Poedit-Country: \n"
15
  "X-Poedit-SourceCharset: utf-8\n"
@@ -19,389 +20,378 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
- #: classes/class.wooconditions.php:55
23
  #@ woosidebars
24
  msgid "Conditions"
25
  msgstr ""
26
 
27
- #: classes/class.wooconditions.php:120
28
- #: classes/class.wooconditions.php:282
29
  #@ woosidebars
30
  msgid "Pages"
31
  msgstr ""
32
 
33
- #: classes/class.wooconditions.php:126
34
  #, php-format
35
  #@ woosidebars
36
  msgid "The \"%s\" page"
37
  msgstr ""
38
 
39
- #: classes/class.wooconditions.php:186
40
  #, php-format
41
  #@ woosidebars
42
  msgid "A custom sidebar for \"%s\""
43
  msgstr ""
44
 
45
- #: classes/class.wooconditions.php:199
46
  #@ woosidebars
47
  msgid "Page Templates"
48
  msgstr ""
49
 
50
- #: classes/class.wooconditions.php:205
51
  #, php-format
52
  #@ woosidebars
53
  msgid "The \"%s\" page template"
54
  msgstr ""
55
 
56
- #: classes/class.wooconditions.php:215
57
  #@ woosidebars
58
  msgid "Post Types"
59
  msgstr ""
60
 
61
- #: classes/class.wooconditions.php:222
62
  #, php-format
63
  #@ woosidebars
64
  msgid "\"%s\" Post Type Archive"
65
  msgstr ""
66
 
67
- #: classes/class.wooconditions.php:223
68
  #, php-format
69
  #@ woosidebars
70
  msgid "The \"%s\" post type archive"
71
  msgstr ""
72
 
73
- #: classes/class.wooconditions.php:231
74
- #, php-format
75
- #@ woosidebars
76
- msgid "Individual %s"
77
- msgstr ""
78
-
79
- #: classes/class.wooconditions.php:232
80
  #, php-format
81
  #@ woosidebars
82
  msgid "Entries in the \"%s\" post type"
83
  msgstr ""
84
 
85
- #: classes/class.wooconditions.php:250
86
  #@ woosidebars
87
  msgid "Taxonomy Archives"
88
  msgstr ""
89
 
90
- #: classes/class.wooconditions.php:258
91
  #, php-format
92
  #@ woosidebars
93
  msgid "The default \"%s\" archives"
94
  msgstr ""
95
 
96
- #: classes/class.wooconditions.php:267
97
  #, php-format
98
  #@ woosidebars
99
  msgid "The %s %s archive"
100
  msgstr ""
101
 
102
- #: classes/class.wooconditions.php:283
103
  #@ woosidebars
104
  msgid "Displayed on all pages that don't have a more specific widget area."
105
  msgstr ""
106
 
107
- #: classes/class.wooconditions.php:287
108
  #@ woosidebars
109
  msgid "Search Results"
110
  msgstr ""
111
 
112
- #: classes/class.wooconditions.php:288
113
  #@ woosidebars
114
  msgid "Displayed on search results screens."
115
  msgstr ""
116
 
117
- #: classes/class.wooconditions.php:292
118
  #@ woosidebars
119
  msgid "Default \"Your Latest Posts\" Screen"
120
  msgstr ""
121
 
122
- #: classes/class.wooconditions.php:293
123
  #@ woosidebars
124
  msgid "Displayed on the default \"Your Latest Posts\" screen."
125
  msgstr ""
126
 
127
- #: classes/class.wooconditions.php:297
128
  #@ woosidebars
129
  msgid "Front Page"
130
  msgstr ""
131
 
132
- #: classes/class.wooconditions.php:298
133
  #@ woosidebars
134
  msgid "Displayed on any front page, regardless of the settings under the \"Settings -> Reading\" admin screen."
135
  msgstr ""
136
 
137
- #: classes/class.wooconditions.php:302
138
  #@ woosidebars
139
  msgid "Single Entries"
140
  msgstr ""
141
 
142
- #: classes/class.wooconditions.php:303
143
  #@ woosidebars
144
  msgid "Displayed on single entries of any public post type other than \"Pages\"."
145
  msgstr ""
146
 
147
- #: classes/class.wooconditions.php:307
148
  #@ woosidebars
149
  msgid "All Archives"
150
  msgstr ""
151
 
152
- #: classes/class.wooconditions.php:308
153
  #@ woosidebars
154
  msgid "Displayed on all archives (category, tag, taxonomy, post type, dated, author and search)."
155
  msgstr ""
156
 
157
- #: classes/class.wooconditions.php:312
158
  #@ woosidebars
159
  msgid "Author Archives"
160
  msgstr ""
161
 
162
- #: classes/class.wooconditions.php:313
163
  #@ woosidebars
164
  msgid "Displayed on all author archive screens (that don't have a more specific sidebar)."
165
  msgstr ""
166
 
167
- #: classes/class.wooconditions.php:317
168
  #@ woosidebars
169
  msgid "Date Archives"
170
  msgstr ""
171
 
172
- #: classes/class.wooconditions.php:318
173
  #@ woosidebars
174
  msgid "Displayed on all date archives."
175
  msgstr ""
176
 
177
- #: classes/class.wooconditions.php:322
178
  #@ woosidebars
179
  msgid "404 Error Screens"
180
  msgstr ""
181
 
182
- #: classes/class.wooconditions.php:323
183
  #@ woosidebars
184
  msgid "Displayed on all 404 error screens."
185
  msgstr ""
186
 
187
- #: classes/class.wooconditions.php:520
188
  #@ woosidebars
189
  msgid "Taxonomy Terms"
190
  msgstr ""
191
 
192
- #: classes/class.wooconditions.php:527
193
  #@ woosidebars
194
  msgid "Advanced"
195
  msgstr ""
196
 
197
- #: classes/class.wooconditions.php:579
198
  #@ woosidebars
199
  msgid "Taxonomy Token"
200
  msgstr ""
201
 
202
- #: classes/class.woosidebars.php:159
203
  #@ woosidebars
204
  msgid "Widget Area"
205
  msgstr ""
206
 
207
- #: classes/class.woosidebars.php:160
208
- #: classes/class.woosidebars.php:173
209
  #@ woosidebars
210
  msgid "Widget Areas"
211
  msgstr ""
212
 
213
- #: classes/class.woosidebars.php:167
214
  #@ woosidebars
215
  msgctxt "post type general name"
216
  msgid "Widget Areas"
217
  msgstr ""
218
 
219
- #: classes/class.woosidebars.php:168
220
  #@ woosidebars
221
  msgctxt "post type singular name"
222
  msgid "Widget Area"
223
  msgstr ""
224
 
225
- #: classes/class.woosidebars.php:169
226
  #@ default
227
  msgctxt "Widget Area"
228
  msgid "Add New"
229
  msgstr ""
230
 
231
- #: classes/class.woosidebars.php:170
232
  #, php-format
233
  #@ woosidebars
234
  msgid "Add New %s"
235
  msgstr ""
236
 
237
- #: classes/class.woosidebars.php:171
238
  #, php-format
239
  #@ woosidebars
240
  msgid "Edit %s"
241
  msgstr ""
242
 
243
- #: classes/class.woosidebars.php:172
244
  #, php-format
245
  #@ woosidebars
246
  msgid "New %s"
247
  msgstr ""
248
 
249
- #: classes/class.woosidebars.php:174
250
  #, php-format
251
  #@ woosidebars
252
  msgid "View %s"
253
  msgstr ""
254
 
255
- #: classes/class.woosidebars.php:175
256
  #, php-format
257
  #@ woosidebars
258
  msgid "Search %a"
259
  msgstr ""
260
 
261
- #: classes/class.woosidebars.php:176
262
  #, php-format
263
  #@ woosidebars
264
  msgid "No %s Found"
265
  msgstr ""
266
 
267
- #: classes/class.woosidebars.php:177
268
  #, php-format
269
  #@ woosidebars
270
  msgid "No %s Found In Trash"
271
  msgstr ""
272
 
273
- #: classes/class.woosidebars.php:228
274
  #@ woosidebars
275
  msgid "(Not in use by current theme)"
276
  msgstr ""
277
 
278
- #: classes/class.woosidebars.php:263
279
- #: classes/class.woosidebars.php:293
280
  #@ woosidebars
281
  msgid "Sidebar To Replace"
282
  msgstr ""
283
 
284
- #: classes/class.woosidebars.php:263
285
  #@ woosidebars
286
  msgid "Condition(s)"
287
  msgstr ""
288
 
289
- #: classes/class.woosidebars.php:300
290
- #: classes/class.woosidebars.php:382
291
  #@ woosidebars
292
  msgid "Description"
293
  msgstr ""
294
 
295
- #: classes/class.woosidebars.php:327
296
  #@ woosidebars
297
  msgid "No sidebars are available with this theme."
298
  msgstr ""
299
 
300
- #: classes/class.woosidebars.php:383
301
  #, php-format
302
  #@ woosidebars
303
  msgid "Add an optional description, to be displayed when adding widgets to this widget area on the %sWidgets%s screen."
304
  msgstr ""
305
 
306
- #: classes/class.woosidebars.php:396
307
  #@ woosidebars
308
  msgid "Enter widget area name here"
309
  msgstr ""
310
 
311
- #: classes/class.woosidebars.php:413
312
  #@ woosidebars
313
  msgid "Widget Area updated."
314
  msgstr ""
315
 
316
- #: classes/class.woosidebars.php:634
317
  #@ woosidebars
318
  msgid "Custom Sidebars"
319
  msgstr ""
320
 
321
- #: classes/class.woosidebars.php:685
322
  #@ woosidebars
323
  msgid "You do not have sufficient permissions to access this page."
324
  msgstr ""
325
 
326
- #: classes/class.woosidebars.php:687
327
  #@ woosidebars
328
  msgid "You have taken too long. Please go back and retry."
329
  msgstr ""
330
 
331
- #: classes/class.woosidebars.php:746
332
  #@ woosidebars
333
  msgid "Overview"
334
  msgstr ""
335
 
336
- #: classes/class.woosidebars.php:748
337
  #@ woosidebars
338
  msgid "All custom widget areas are listed on this screen. To add a new customised widget area, click the \"Add New\" button."
339
  msgstr ""
340
 
341
- #: classes/class.woosidebars.php:752
342
  #@ woosidebars
343
  msgid "Sidebar Manager"
344
  msgstr ""
345
 
346
- #: classes/class.woosidebars.php:754
347
  #@ woosidebars
348
  msgid "WooSidebars is intended to replace the Sidebar Manager found in the WooFramework. Please ensure that all sidebars have been transferred over from the Sidebar Manager, if you choose to use WooSidebars instead."
349
  msgstr ""
350
 
351
- #: classes/class.woosidebars.php:755
352
  #@ woosidebars
353
  msgid "To transfer a sidebar from the Sidebar Manager:"
354
  msgstr ""
355
 
356
- #: classes/class.woosidebars.php:757
357
  #@ woosidebars
358
  msgid "Create a new custom widget area in WooSidebars."
359
  msgstr ""
360
 
361
- #: classes/class.woosidebars.php:758
362
  #, php-format
363
  #@ woosidebars
364
  msgid "Visit the %sAppearance &rarr; Widgets%s screen and drag the widgets from the old sidebar into the newly created sidebar."
365
  msgstr ""
366
 
367
- #: classes/class.woosidebars.php:759
368
  #@ woosidebars
369
  msgid "Repeat this process for each of your custom sidebars, including dependencies if necessary (the WooSidebars conditions system replaces the need for dependencies)."
370
  msgstr ""
371
 
372
- #: classes/class.woosidebars.php:760
373
  #@ woosidebars
374
  msgid "Once you are certain that you widgets have been moved across for all widget areas, remove the sidebar from the Sidebar Manager (don't forget to transfer any dependencies over as well, if necessary)."
375
  msgstr ""
376
 
377
- #: classes/class.woosidebars.php:765
378
  #@ woosidebars
379
  msgid "For more information:"
380
  msgstr ""
381
 
382
- #: classes/class.woosidebars.php:766
383
- #@ woosidebars
384
- msgid "Support Forums"
385
- msgstr ""
386
-
387
- #: classes/class.woosidebars.php:767
388
  #@ woosidebars
389
  msgid "WooSidebars Documentation"
390
  msgstr ""
391
 
392
- #: classes/class.wooconditions.php:269
393
  #, php-format
394
  #@ woosidebars
395
  msgid "All posts in \"%s\""
396
  msgstr ""
397
 
398
- #: classes/class.wooconditions.php:269
399
  #, php-format
400
  #@ woosidebars
401
  msgid "All posts in the %s %s archive"
402
  msgstr ""
403
 
404
- #: classes/class.wooconditions.php:278
405
  #@ woosidebars
406
  msgid "Template Hierarchy"
407
  msgstr ""
@@ -493,3 +483,14 @@ msgstr ""
493
  msgid "Products tagged \"%s\""
494
  msgstr ""
495
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WooSidebars v1.3.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2013-08-12 11:40:12+0000\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Generator: CSL v1.x\n"
14
  "X-Poedit-Language: \n"
15
  "X-Poedit-Country: \n"
16
  "X-Poedit-SourceCharset: utf-8\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Textdomain-Support: yes"
22
 
23
+ #: classes/class-woo-conditions.php:57
24
  #@ woosidebars
25
  msgid "Conditions"
26
  msgstr ""
27
 
28
+ #: classes/class-woo-conditions.php:127
29
+ #: classes/class-woo-conditions.php:296
30
  #@ woosidebars
31
  msgid "Pages"
32
  msgstr ""
33
 
34
+ #: classes/class-woo-conditions.php:138
35
  #, php-format
36
  #@ woosidebars
37
  msgid "The \"%s\" page"
38
  msgstr ""
39
 
40
+ #: classes/class-woo-conditions.php:201
41
  #, php-format
42
  #@ woosidebars
43
  msgid "A custom sidebar for \"%s\""
44
  msgstr ""
45
 
46
+ #: classes/class-woo-conditions.php:214
47
  #@ woosidebars
48
  msgid "Page Templates"
49
  msgstr ""
50
 
51
+ #: classes/class-woo-conditions.php:220
52
  #, php-format
53
  #@ woosidebars
54
  msgid "The \"%s\" page template"
55
  msgstr ""
56
 
57
+ #: classes/class-woo-conditions.php:230
58
  #@ woosidebars
59
  msgid "Post Types"
60
  msgstr ""
61
 
62
+ #: classes/class-woo-conditions.php:237
63
  #, php-format
64
  #@ woosidebars
65
  msgid "\"%s\" Post Type Archive"
66
  msgstr ""
67
 
68
+ #: classes/class-woo-conditions.php:238
69
  #, php-format
70
  #@ woosidebars
71
  msgid "The \"%s\" post type archive"
72
  msgstr ""
73
 
74
+ #: classes/class-woo-conditions.php:247
 
 
 
 
 
 
75
  #, php-format
76
  #@ woosidebars
77
  msgid "Entries in the \"%s\" post type"
78
  msgstr ""
79
 
80
+ #: classes/class-woo-conditions.php:264
81
  #@ woosidebars
82
  msgid "Taxonomy Archives"
83
  msgstr ""
84
 
85
+ #: classes/class-woo-conditions.php:272
86
  #, php-format
87
  #@ woosidebars
88
  msgid "The default \"%s\" archives"
89
  msgstr ""
90
 
91
+ #: classes/class-woo-conditions.php:281
92
  #, php-format
93
  #@ woosidebars
94
  msgid "The %s %s archive"
95
  msgstr ""
96
 
97
+ #: classes/class-woo-conditions.php:297
98
  #@ woosidebars
99
  msgid "Displayed on all pages that don't have a more specific widget area."
100
  msgstr ""
101
 
102
+ #: classes/class-woo-conditions.php:301
103
  #@ woosidebars
104
  msgid "Search Results"
105
  msgstr ""
106
 
107
+ #: classes/class-woo-conditions.php:302
108
  #@ woosidebars
109
  msgid "Displayed on search results screens."
110
  msgstr ""
111
 
112
+ #: classes/class-woo-conditions.php:306
113
  #@ woosidebars
114
  msgid "Default \"Your Latest Posts\" Screen"
115
  msgstr ""
116
 
117
+ #: classes/class-woo-conditions.php:307
118
  #@ woosidebars
119
  msgid "Displayed on the default \"Your Latest Posts\" screen."
120
  msgstr ""
121
 
122
+ #: classes/class-woo-conditions.php:311
123
  #@ woosidebars
124
  msgid "Front Page"
125
  msgstr ""
126
 
127
+ #: classes/class-woo-conditions.php:312
128
  #@ woosidebars
129
  msgid "Displayed on any front page, regardless of the settings under the \"Settings -> Reading\" admin screen."
130
  msgstr ""
131
 
132
+ #: classes/class-woo-conditions.php:316
133
  #@ woosidebars
134
  msgid "Single Entries"
135
  msgstr ""
136
 
137
+ #: classes/class-woo-conditions.php:317
138
  #@ woosidebars
139
  msgid "Displayed on single entries of any public post type other than \"Pages\"."
140
  msgstr ""
141
 
142
+ #: classes/class-woo-conditions.php:321
143
  #@ woosidebars
144
  msgid "All Archives"
145
  msgstr ""
146
 
147
+ #: classes/class-woo-conditions.php:322
148
  #@ woosidebars
149
  msgid "Displayed on all archives (category, tag, taxonomy, post type, dated, author and search)."
150
  msgstr ""
151
 
152
+ #: classes/class-woo-conditions.php:326
153
  #@ woosidebars
154
  msgid "Author Archives"
155
  msgstr ""
156
 
157
+ #: classes/class-woo-conditions.php:327
158
  #@ woosidebars
159
  msgid "Displayed on all author archive screens (that don't have a more specific sidebar)."
160
  msgstr ""
161
 
162
+ #: classes/class-woo-conditions.php:331
163
  #@ woosidebars
164
  msgid "Date Archives"
165
  msgstr ""
166
 
167
+ #: classes/class-woo-conditions.php:332
168
  #@ woosidebars
169
  msgid "Displayed on all date archives."
170
  msgstr ""
171
 
172
+ #: classes/class-woo-conditions.php:336
173
  #@ woosidebars
174
  msgid "404 Error Screens"
175
  msgstr ""
176
 
177
+ #: classes/class-woo-conditions.php:337
178
  #@ woosidebars
179
  msgid "Displayed on all 404 error screens."
180
  msgstr ""
181
 
182
+ #: classes/class-woo-conditions.php:545
183
  #@ woosidebars
184
  msgid "Taxonomy Terms"
185
  msgstr ""
186
 
187
+ #: classes/class-woo-conditions.php:554
188
  #@ woosidebars
189
  msgid "Advanced"
190
  msgstr ""
191
 
192
+ #: classes/class-woo-conditions.php:604
193
  #@ woosidebars
194
  msgid "Taxonomy Token"
195
  msgstr ""
196
 
197
+ #: classes/class-woo-sidebars.php:156
198
  #@ woosidebars
199
  msgid "Widget Area"
200
  msgstr ""
201
 
202
+ #: classes/class-woo-sidebars.php:157
203
+ #: classes/class-woo-sidebars.php:170
204
  #@ woosidebars
205
  msgid "Widget Areas"
206
  msgstr ""
207
 
208
+ #: classes/class-woo-sidebars.php:164
209
  #@ woosidebars
210
  msgctxt "post type general name"
211
  msgid "Widget Areas"
212
  msgstr ""
213
 
214
+ #: classes/class-woo-sidebars.php:165
215
  #@ woosidebars
216
  msgctxt "post type singular name"
217
  msgid "Widget Area"
218
  msgstr ""
219
 
220
+ #: classes/class-woo-sidebars.php:166
221
  #@ default
222
  msgctxt "Widget Area"
223
  msgid "Add New"
224
  msgstr ""
225
 
226
+ #: classes/class-woo-sidebars.php:167
227
  #, php-format
228
  #@ woosidebars
229
  msgid "Add New %s"
230
  msgstr ""
231
 
232
+ #: classes/class-woo-sidebars.php:168
233
  #, php-format
234
  #@ woosidebars
235
  msgid "Edit %s"
236
  msgstr ""
237
 
238
+ #: classes/class-woo-sidebars.php:169
239
  #, php-format
240
  #@ woosidebars
241
  msgid "New %s"
242
  msgstr ""
243
 
244
+ #: classes/class-woo-sidebars.php:171
245
  #, php-format
246
  #@ woosidebars
247
  msgid "View %s"
248
  msgstr ""
249
 
250
+ #: classes/class-woo-sidebars.php:172
251
  #, php-format
252
  #@ woosidebars
253
  msgid "Search %a"
254
  msgstr ""
255
 
256
+ #: classes/class-woo-sidebars.php:173
257
  #, php-format
258
  #@ woosidebars
259
  msgid "No %s Found"
260
  msgstr ""
261
 
262
+ #: classes/class-woo-sidebars.php:174
263
  #, php-format
264
  #@ woosidebars
265
  msgid "No %s Found In Trash"
266
  msgstr ""
267
 
268
+ #: classes/class-woo-sidebars.php:225
269
  #@ woosidebars
270
  msgid "(Not in use by current theme)"
271
  msgstr ""
272
 
273
+ #: classes/class-woo-sidebars.php:260
274
+ #: classes/class-woo-sidebars.php:290
275
  #@ woosidebars
276
  msgid "Sidebar To Replace"
277
  msgstr ""
278
 
279
+ #: classes/class-woo-sidebars.php:260
280
  #@ woosidebars
281
  msgid "Condition(s)"
282
  msgstr ""
283
 
284
+ #: classes/class-woo-sidebars.php:297
285
+ #: classes/class-woo-sidebars.php:379
286
  #@ woosidebars
287
  msgid "Description"
288
  msgstr ""
289
 
290
+ #: classes/class-woo-sidebars.php:324
291
  #@ woosidebars
292
  msgid "No sidebars are available with this theme."
293
  msgstr ""
294
 
295
+ #: classes/class-woo-sidebars.php:380
296
  #, php-format
297
  #@ woosidebars
298
  msgid "Add an optional description, to be displayed when adding widgets to this widget area on the %sWidgets%s screen."
299
  msgstr ""
300
 
301
+ #: classes/class-woo-sidebars.php:393
302
  #@ woosidebars
303
  msgid "Enter widget area name here"
304
  msgstr ""
305
 
306
+ #: classes/class-woo-sidebars.php:410
307
  #@ woosidebars
308
  msgid "Widget Area updated."
309
  msgstr ""
310
 
311
+ #: classes/class-woo-sidebars.php:641
312
  #@ woosidebars
313
  msgid "Custom Sidebars"
314
  msgstr ""
315
 
316
+ #: classes/class-woo-sidebars.php:687
317
  #@ woosidebars
318
  msgid "You do not have sufficient permissions to access this page."
319
  msgstr ""
320
 
321
+ #: classes/class-woo-sidebars.php:688
322
  #@ woosidebars
323
  msgid "You have taken too long. Please go back and retry."
324
  msgstr ""
325
 
326
+ #: classes/class-woo-sidebars.php:747
327
  #@ woosidebars
328
  msgid "Overview"
329
  msgstr ""
330
 
331
+ #: classes/class-woo-sidebars.php:749
332
  #@ woosidebars
333
  msgid "All custom widget areas are listed on this screen. To add a new customised widget area, click the \"Add New\" button."
334
  msgstr ""
335
 
336
+ #: classes/class-woo-sidebars.php:753
337
  #@ woosidebars
338
  msgid "Sidebar Manager"
339
  msgstr ""
340
 
341
+ #: classes/class-woo-sidebars.php:755
342
  #@ woosidebars
343
  msgid "WooSidebars is intended to replace the Sidebar Manager found in the WooFramework. Please ensure that all sidebars have been transferred over from the Sidebar Manager, if you choose to use WooSidebars instead."
344
  msgstr ""
345
 
346
+ #: classes/class-woo-sidebars.php:756
347
  #@ woosidebars
348
  msgid "To transfer a sidebar from the Sidebar Manager:"
349
  msgstr ""
350
 
351
+ #: classes/class-woo-sidebars.php:758
352
  #@ woosidebars
353
  msgid "Create a new custom widget area in WooSidebars."
354
  msgstr ""
355
 
356
+ #: classes/class-woo-sidebars.php:759
357
  #, php-format
358
  #@ woosidebars
359
  msgid "Visit the %sAppearance &rarr; Widgets%s screen and drag the widgets from the old sidebar into the newly created sidebar."
360
  msgstr ""
361
 
362
+ #: classes/class-woo-sidebars.php:760
363
  #@ woosidebars
364
  msgid "Repeat this process for each of your custom sidebars, including dependencies if necessary (the WooSidebars conditions system replaces the need for dependencies)."
365
  msgstr ""
366
 
367
+ #: classes/class-woo-sidebars.php:761
368
  #@ woosidebars
369
  msgid "Once you are certain that you widgets have been moved across for all widget areas, remove the sidebar from the Sidebar Manager (don't forget to transfer any dependencies over as well, if necessary)."
370
  msgstr ""
371
 
372
+ #: classes/class-woo-sidebars.php:766
373
  #@ woosidebars
374
  msgid "For more information:"
375
  msgstr ""
376
 
377
+ #: classes/class-woo-sidebars.php:768
 
 
 
 
 
378
  #@ woosidebars
379
  msgid "WooSidebars Documentation"
380
  msgstr ""
381
 
382
+ #: classes/class-woo-conditions.php:283
383
  #, php-format
384
  #@ woosidebars
385
  msgid "All posts in \"%s\""
386
  msgstr ""
387
 
388
+ #: classes/class-woo-conditions.php:283
389
  #, php-format
390
  #@ woosidebars
391
  msgid "All posts in the %s %s archive"
392
  msgstr ""
393
 
394
+ #: classes/class-woo-conditions.php:292
395
  #@ woosidebars
396
  msgid "Template Hierarchy"
397
  msgstr ""
483
  msgid "Products tagged \"%s\""
484
  msgstr ""
485
 
486
+ #: classes/class-woo-conditions.php:246
487
+ #, php-format
488
+ #@ woosidebars
489
+ msgid "Each Individual %s"
490
+ msgstr ""
491
+
492
+ #: classes/class-woo-sidebars.php:767
493
+ #@ woosidebars
494
+ msgid "Support HelpDesk"
495
+ msgstr ""
496
+
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: woothemes, mattyza
3
  Tags: widgets, sidebars, widget-areas
4
  Requires at least: 3.3
5
- Tested up to: 3.5.1
6
- Stable tag: 1.2.2
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
  WooSidebars adds functionality to display different widgets in a sidebar, according to a context (for example, a specific page or a category).
11
 
@@ -15,10 +15,9 @@ With WooSidebars, it's possible to change the widgets that display in a sidebar
15
 
16
  [vimeo http://vimeo.com/42980663]
17
 
18
- Looking for a helping hand? [View plugin documentation](http://dojodocs.woothemes.com/woosidebars/).
19
 
20
- Looking to contribute code to this plugin? [Fork the repository over at GitHub](http://github.com/woothemes/woosidebars/).
21
- (submit pull requests to the "develop" branch)
22
 
23
  == Installation ==
24
 
@@ -54,7 +53,7 @@ Automatic updates should work a charm; as always though, ensure you backup your
54
 
55
  = Where can I find WooSidebars documentation and user guides? =
56
 
57
- For further documentation on using WooSidebars, please view the [WooSidebars Documentation](http://dojodocs.woothemes.com/woosidebars/).
58
 
59
  = Will WooSidebars work with my theme? =
60
 
@@ -72,6 +71,9 @@ Looking to contribute code to this plugin? [Fork the repository over at GitHub](
72
 
73
  == Upgrade Notice ==
74
 
 
 
 
75
  = 1.2.2 =
76
  "Widget Areas" menu is now only visible to users who can add/modify widgets.
77
 
@@ -83,6 +85,13 @@ Moved to WordPress.org. Woo! Added scope to methods and properties where missing
83
 
84
  == Changelog ==
85
 
 
 
 
 
 
 
 
86
  = 1.2.2 =
87
  * 2013-03-08
88
  * Changes capability for displaying the menu to "edit_theme_options" in line with the "Widgets" menu capability.
2
  Contributors: woothemes, mattyza
3
  Tags: widgets, sidebars, widget-areas
4
  Requires at least: 3.3
5
+ Tested up to: 3.6.0
6
+ Stable tag: 1.3.0
7
+ License: GPLv3 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
  WooSidebars adds functionality to display different widgets in a sidebar, according to a context (for example, a specific page or a category).
11
 
15
 
16
  [vimeo http://vimeo.com/42980663]
17
 
18
+ Looking for a helping hand? [View plugin documentation](http://docs.woothemes.com/documentation/plugins/woosidebars/).
19
 
20
+ Looking to contribute code to this plugin? [Fork the repository over at GitHub](http://github.com/woothemes/woosidebars/). Please also read the CONTRIBUTING.md file, bundled within this plugin.
 
21
 
22
  == Installation ==
23
 
53
 
54
  = Where can I find WooSidebars documentation and user guides? =
55
 
56
+ For further documentation on using WooSidebars, please view the [WooSidebars Documentation](http://docs.woothemes.com/documentation/plugins/woosidebars/).
57
 
58
  = Will WooSidebars work with my theme? =
59
 
71
 
72
  == Upgrade Notice ==
73
 
74
+ = 1.3.0 =
75
+ Optimisation update.
76
+
77
  = 1.2.2 =
78
  "Widget Areas" menu is now only visible to users who can add/modify widgets.
79
 
85
 
86
  == Changelog ==
87
 
88
+ = 1.3.0 =
89
+ * 2013-08-12
90
+ * Introduces woosidebars_upper_limit filter, used on all database queries, to control scaling.
91
+ * Fixes several PHP notices for "undefined index".
92
+ * Fixes "single" condition, where a small section of logic was missing for determining if the condition applied to the current screen being loaded.
93
+ * Optimises admin-side JavaScript and CSS.
94
+
95
  = 1.2.2 =
96
  * 2013-03-08
97
  * Changes capability for displaying the menu to "edit_theme_options" in line with the "Widgets" menu capability.
woosidebars.php CHANGED
@@ -5,8 +5,8 @@
5
  * Description: Replace widget areas in your theme for specific pages, archives and other sections of WordPress.
6
  * Author: WooThemes
7
  * Author URI: http://woothemes.com/
8
- * Version: 1.2.2
9
- * Stable tag: 1.2.2
10
  * License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
@@ -22,6 +22,6 @@
22
 
23
  global $woosidebars;
24
  $woosidebars = new Woo_Sidebars( __FILE__ );
25
- $woosidebars->version = '1.2.2';
26
  $woosidebars->init();
27
  ?>
5
  * Description: Replace widget areas in your theme for specific pages, archives and other sections of WordPress.
6
  * Author: WooThemes
7
  * Author URI: http://woothemes.com/
8
+ * Version: 1.3.0
9
+ * Stable tag: 1.3.0
10
  * License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
11
  */
12
 
22
 
23
  global $woosidebars;
24
  $woosidebars = new Woo_Sidebars( __FILE__ );
25
+ $woosidebars->version = '1.3.0';
26
  $woosidebars->init();
27
  ?>