Simply Exclude - Version 2.0.6

Version Description

2013-03-20 Bug fixes for Illegal string offset 'action' PHP Warnings.

Download this release

Release Info

Developer pmenard
Plugin Icon wp plugin Simply Exclude
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

Files changed (2) hide show
  1. readme.txt +5 -1
  2. simplyexclude.php +28 -18
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.codehooligans.com
4
  Tags: admin, posts, pages, categories, tags, Post Type, Taxonomy, exclude, include, is_front, is_archive, is_search, is_feed, is_author
5
  Requires at least: 3.2
6
  Tested up to: 3.3.1
7
- Stable tag: 2.0.4Beta2
8
 
9
  == Description ==
10
 
@@ -48,6 +48,10 @@ At the time (version 1.6.1) the plugin only effects Pages included in the tradit
48
 
49
  == Changelog ==
50
 
 
 
 
 
51
  = 2.0.5 =
52
  2012-05-16
53
  More tweaks to the widget exclude logic and cleanup logic on main query vs extra query.
4
  Tags: admin, posts, pages, categories, tags, Post Type, Taxonomy, exclude, include, is_front, is_archive, is_search, is_feed, is_author
5
  Requires at least: 3.2
6
  Tested up to: 3.3.1
7
+ Stable tag: 2.0.6
8
 
9
  == Description ==
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 2.0.6 =
52
+ 2013-03-20
53
+ Bug fixes for Illegal string offset 'action' PHP Warnings.
54
+
55
  = 2.0.5 =
56
  2012-05-16
57
  More tweaks to the widget exclude logic and cleanup logic on main query vs extra query.
simplyexclude.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Simply Exclude
4
  Plugin URI: http://www.codehooligans.com/projects/wordpress/simply-exclude/
5
  Description: Provides an interface to selectively exclude/include all Taxonomies, Post Types and Users from the 4 actions used by WordPress. is_front, is_archive, is_search, is_feed. Also provides access to some of the common widgets user like tag cloud and categories listings.
6
  Author: Paul Menard
7
- Version: 2.0.5
8
  Author URI: http://www.codehooligans.com
9
 
10
  Revision history
@@ -24,6 +24,7 @@ Revision history
24
  2.0.3 - 2012-03-18 Fixes to core filtering logic.
25
  2.0.4 - 2012-05-16 Added new Settings option to allow control of filtering the main page WPQuery only or all WPQuery requests. Added exclusion for common post_types. General bug fixed for reported issues where filter was either not occurring or that filter was causing a blank page or missing navigation.
26
  2.0.5 - 2012-05-17 More tweaks to the widget exclude logic and cleanup logic on main query vs extra query.
 
27
  */
28
 
29
  define('SIMPLY_EXCLUDE_I18N_DOMAIN', 'simplyexclude');
@@ -168,7 +169,7 @@ class SimplyExclude
168
  && ($this->se_cfg['data']['taxonomies'][$t_item->name]['options']['showhide'] == 'show'))
169
  {
170
  add_filter( "manage_edit-". $t_item->name ."_columns", array( &$this, 'se_manage_taxonomy_columns' ), 99, 1);
171
- add_filter( "manage_". $t_item->name. "_custom_column", array(&$this, 'se_display_taxonomy_column_actions'), 99, 3);
172
  }
173
  }
174
  //add_action("delete_term", array(&$this, 'se_delete_taxonomy_term'), 99, 3);
@@ -184,7 +185,7 @@ class SimplyExclude
184
  && ($this->se_cfg['data']['post_types'][$t_item->name]['options']['showhide'] == 'show'))
185
  {
186
  add_filter( "manage_". $t_item->name ."_posts_columns", array( &$this, 'se_manage_post_type_columns' ), 99 );
187
- add_filter( "manage_". $t_item->name ."_posts_custom_column", array(&$this, 'se_display_post_type_column_actions'), 99, 3);
188
 
189
  add_meta_box($this->options_key, $this->admin_menu_label, array(&$this,'show_post_type_exclude_sidebar_dbx'), $t_item->name, 'side');
190
  add_action('save_post', array(&$this,'save_post_type_exclude_sidebar_dbx'));
@@ -310,7 +311,7 @@ class SimplyExclude
310
  <tbody>
311
  <?php
312
  $class="";
313
-
314
  foreach ($this->current_taxonomy['actions'] as $action_key => $action_val)
315
  {
316
  $class = ('alternate' == $class) ? '' : 'alternate';
@@ -320,9 +321,9 @@ class SimplyExclude
320
  <td class="description"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'description');//$action_val['description'] ?></td>
321
  <td class="inc-excl">
322
  <input type="radio" name="se_cfg[<?php echo $taxonomy; ?>][actions][<?php echo $action_key ?>]" value="i"
323
- <?php if ($action_val['action'] == 'i') echo "checked='checked'"; ?> /> <?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?><br />
324
  <input type="radio" name="se_cfg[<?php echo $taxonomy; ?>][actions][<?php echo $action_key ?>]" value="e"
325
- <?php if ($action_val['action'] == 'e') echo "checked='checked'"; ?> /> <?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
326
  </td>
327
  <tr>
328
  <?php
@@ -363,16 +364,16 @@ class SimplyExclude
363
  <td class="description"><?php echo $this->get_post_type_action_label($post_type, $action_key, 'description'); ?></td>
364
  <td class="inc-excl">
365
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="i"
366
- <?php if ($action_val['action'] == 'i') echo "checked='checked'"; ?> /> <?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?><br />
367
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="e"
368
- <?php if ($action_val['action'] == 'e') echo "checked='checked'"; ?> /> <?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
369
  <?php
370
  if (($action_key == "is_home")
371
  && ((isset($this->current_post_type['options']['capability_type'])) && ($this->current_post_type['options']['capability_type'] == "post")))
372
  {
373
  ?><br />
374
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="a"
375
- <?php if ($action_val['action'] == 'a') echo "checked='checked'"; ?> /> <?php _e('Include All', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
376
  <?php
377
  }
378
 
@@ -381,7 +382,7 @@ class SimplyExclude
381
  {
382
  ?><br />
383
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="a"
384
- <?php if ($action_val['action'] == 'a') echo "checked='checked'"; ?> /> <?php _e('Include All', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
385
  <?php
386
  }
387
  ?>
@@ -425,9 +426,9 @@ class SimplyExclude
425
  <td class="description"><?php echo $this->get_se_type_action_label($se_type, $action_key, 'description'); ?></td>
426
  <td class="inc-excl">
427
  <input type="radio" name="se_cfg[<?php echo $se_type; ?>][actions][<?php echo $action_key ?>]" value="i"
428
- <?php if ($action_val['action'] == 'i') echo "checked='checked'"; ?> /> <?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?><br />
429
  <input type="radio" name="se_cfg[<?php echo $se_type; ?>][actions][<?php echo $action_key ?>]" value="e"
430
- <?php if ($action_val['action'] == 'e') echo "checked='checked'"; ?> /> <?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
431
  </td>
432
  <tr>
433
  <?php
@@ -805,7 +806,7 @@ class SimplyExclude
805
  /* */
806
  /****************************************************************************************************************************/
807
 
808
- function se_display_taxonomy_column_actions($junk, $column_name, $term_id)
809
  {
810
  global $taxonomy, $post_type;
811
 
@@ -818,11 +819,17 @@ class SimplyExclude
818
  if ($term)
819
  {
820
  $this->current_taxonomy = $this->se_cfg['data']['taxonomies'][$taxonomy];
 
 
821
  $this->se_display_taxonomy_term_action_row($taxonomy, $term);
 
 
 
822
  }
823
  }
824
  }
825
  }
 
826
  }
827
 
828
  function se_display_post_type_column_actions($column_name, $post_id)
@@ -846,7 +853,7 @@ class SimplyExclude
846
  }
847
  }
848
 
849
- function se_display_user_column_actions($junk, $column_name, $user_id )
850
  {
851
  if (current_user_can('manage_options')) {
852
  if ($column_name == "se-actions")
@@ -872,6 +879,7 @@ class SimplyExclude
872
  }
873
  }
874
  }
 
875
  }
876
 
877
 
@@ -2251,10 +2259,12 @@ class SimplyExclude
2251
  if (!$action) return;
2252
 
2253
  $action_data = array();
 
2254
 
2255
  //echo "se_cfg taxonomies<pre>"; print_r($this->se_cfg['data']['taxonomies']); echo "</pre>";
2256
  foreach($this->se_cfg['data']['taxonomies'] as $key => $data)
2257
  {
 
2258
  if ((isset($data['options']['active'])) && ($data['options']['active'] == 'yes'))
2259
  {
2260
  if ((!isset($data['terms'][$action])) || (!count($data['terms'][$action])))
@@ -2264,7 +2274,7 @@ class SimplyExclude
2264
  {
2265
  $action_data['taxonomies'][$key]['terms'][] = $id;
2266
  }
2267
- $action_data['taxonomies'][$key]['actions'] = $data['actions'][$action]['action'];
2268
  }
2269
  }
2270
 
@@ -2277,7 +2287,7 @@ class SimplyExclude
2277
  {
2278
  if ((isset($data['actions'][$action]['action'])) && ($data['actions'][$action]['action'] == 'a'))
2279
  {
2280
- $action_data['post_types'][$key]['actions'] = $data['actions'][$action]['action'];
2281
  }
2282
  continue;
2283
  }
@@ -2287,7 +2297,7 @@ class SimplyExclude
2287
  $action_data['post_types'][$key]['terms'][] = $id;
2288
  }
2289
 
2290
- $action_data['post_types'][$key]['actions'] = $data['actions'][$action]['action'];
2291
  }
2292
  }
2293
 
@@ -2304,7 +2314,7 @@ class SimplyExclude
2304
  $action_data['se_types'][$key]['terms'][] = $id;
2305
  }
2306
 
2307
- $action_data['se_types'][$key]['actions'] = $data['actions'][$action]['action'];
2308
  }
2309
 
2310
  }
4
  Plugin URI: http://www.codehooligans.com/projects/wordpress/simply-exclude/
5
  Description: Provides an interface to selectively exclude/include all Taxonomies, Post Types and Users from the 4 actions used by WordPress. is_front, is_archive, is_search, is_feed. Also provides access to some of the common widgets user like tag cloud and categories listings.
6
  Author: Paul Menard
7
+ Version: 2.0.6
8
  Author URI: http://www.codehooligans.com
9
 
10
  Revision history
24
  2.0.3 - 2012-03-18 Fixes to core filtering logic.
25
  2.0.4 - 2012-05-16 Added new Settings option to allow control of filtering the main page WPQuery only or all WPQuery requests. Added exclusion for common post_types. General bug fixed for reported issues where filter was either not occurring or that filter was causing a blank page or missing navigation.
26
  2.0.5 - 2012-05-17 More tweaks to the widget exclude logic and cleanup logic on main query vs extra query.
27
+ 2.0.6 - 2013-03-20 Bug fixes for Illegal string offset 'action' PHP Warnings.
28
  */
29
 
30
  define('SIMPLY_EXCLUDE_I18N_DOMAIN', 'simplyexclude');
169
  && ($this->se_cfg['data']['taxonomies'][$t_item->name]['options']['showhide'] == 'show'))
170
  {
171
  add_filter( "manage_edit-". $t_item->name ."_columns", array( &$this, 'se_manage_taxonomy_columns' ), 99, 1);
172
+ add_filter( "manage_". $t_item->name. "_custom_column", array(&$this, 'se_display_taxonomy_column_filters'), 99, 3);
173
  }
174
  }
175
  //add_action("delete_term", array(&$this, 'se_delete_taxonomy_term'), 99, 3);
185
  && ($this->se_cfg['data']['post_types'][$t_item->name]['options']['showhide'] == 'show'))
186
  {
187
  add_filter( "manage_". $t_item->name ."_posts_columns", array( &$this, 'se_manage_post_type_columns' ), 99 );
188
+ add_action( "manage_". $t_item->name ."_posts_custom_column", array(&$this, 'se_display_post_type_column_actions'), 99, 2);
189
 
190
  add_meta_box($this->options_key, $this->admin_menu_label, array(&$this,'show_post_type_exclude_sidebar_dbx'), $t_item->name, 'side');
191
  add_action('save_post', array(&$this,'save_post_type_exclude_sidebar_dbx'));
311
  <tbody>
312
  <?php
313
  $class="";
314
+
315
  foreach ($this->current_taxonomy['actions'] as $action_key => $action_val)
316
  {
317
  $class = ('alternate' == $class) ? '' : 'alternate';
321
  <td class="description"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'description');//$action_val['description'] ?></td>
322
  <td class="inc-excl">
323
  <input type="radio" name="se_cfg[<?php echo $taxonomy; ?>][actions][<?php echo $action_key ?>]" value="i"
324
+ <?php if ($action_val == 'i') echo "checked='checked'"; ?> /> <?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?><br />
325
  <input type="radio" name="se_cfg[<?php echo $taxonomy; ?>][actions][<?php echo $action_key ?>]" value="e"
326
+ <?php if ($action_val == 'e') echo "checked='checked'"; ?> /> <?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
327
  </td>
328
  <tr>
329
  <?php
364
  <td class="description"><?php echo $this->get_post_type_action_label($post_type, $action_key, 'description'); ?></td>
365
  <td class="inc-excl">
366
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="i"
367
+ <?php if ($action_val == 'i') echo "checked='checked'"; ?> /> <?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?><br />
368
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="e"
369
+ <?php if ($action_val == 'e') echo "checked='checked'"; ?> /> <?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
370
  <?php
371
  if (($action_key == "is_home")
372
  && ((isset($this->current_post_type['options']['capability_type'])) && ($this->current_post_type['options']['capability_type'] == "post")))
373
  {
374
  ?><br />
375
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="a"
376
+ <?php if ($action_val == 'a') echo "checked='checked'"; ?> /> <?php _e('Include All', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
377
  <?php
378
  }
379
 
382
  {
383
  ?><br />
384
  <input type="radio" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="a"
385
+ <?php if ($action_val == 'a') echo "checked='checked'"; ?> /> <?php _e('Include All', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
386
  <?php
387
  }
388
  ?>
426
  <td class="description"><?php echo $this->get_se_type_action_label($se_type, $action_key, 'description'); ?></td>
427
  <td class="inc-excl">
428
  <input type="radio" name="se_cfg[<?php echo $se_type; ?>][actions][<?php echo $action_key ?>]" value="i"
429
+ <?php if ($action_val == 'i') echo "checked='checked'"; ?> /> <?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?><br />
430
  <input type="radio" name="se_cfg[<?php echo $se_type; ?>][actions][<?php echo $action_key ?>]" value="e"
431
+ <?php if ($action_val == 'e') echo "checked='checked'"; ?> /> <?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?>
432
  </td>
433
  <tr>
434
  <?php
806
  /* */
807
  /****************************************************************************************************************************/
808
 
809
+ function se_display_taxonomy_column_filters($content='', $column_name, $term_id)
810
  {
811
  global $taxonomy, $post_type;
812
 
819
  if ($term)
820
  {
821
  $this->current_taxonomy = $this->se_cfg['data']['taxonomies'][$taxonomy];
822
+
823
+ ob_start();
824
  $this->se_display_taxonomy_term_action_row($taxonomy, $term);
825
+ $out = ob_get_contents();
826
+ ob_end_clean();
827
+ return $out;
828
  }
829
  }
830
  }
831
  }
832
+ return $content;
833
  }
834
 
835
  function se_display_post_type_column_actions($column_name, $post_id)
853
  }
854
  }
855
 
856
+ function se_display_user_column_actions($content='', $column_name, $user_id )
857
  {
858
  if (current_user_can('manage_options')) {
859
  if ($column_name == "se-actions")
879
  }
880
  }
881
  }
882
+ return $content;
883
  }
884
 
885
 
2259
  if (!$action) return;
2260
 
2261
  $action_data = array();
2262
+ //echo "action=[". $action ."]<br />";
2263
 
2264
  //echo "se_cfg taxonomies<pre>"; print_r($this->se_cfg['data']['taxonomies']); echo "</pre>";
2265
  foreach($this->se_cfg['data']['taxonomies'] as $key => $data)
2266
  {
2267
+ //echo "data<pre>"; print_r($data); echo "</pre>";
2268
  if ((isset($data['options']['active'])) && ($data['options']['active'] == 'yes'))
2269
  {
2270
  if ((!isset($data['terms'][$action])) || (!count($data['terms'][$action])))
2274
  {
2275
  $action_data['taxonomies'][$key]['terms'][] = $id;
2276
  }
2277
+ $action_data['taxonomies'][$key]['actions'] = $data['actions'][$action];
2278
  }
2279
  }
2280
 
2287
  {
2288
  if ((isset($data['actions'][$action]['action'])) && ($data['actions'][$action]['action'] == 'a'))
2289
  {
2290
+ $action_data['post_types'][$key]['actions'] = $data['actions'][$action];
2291
  }
2292
  continue;
2293
  }
2297
  $action_data['post_types'][$key]['terms'][] = $id;
2298
  }
2299
 
2300
+ $action_data['post_types'][$key]['actions'] = $data['actions'][$action];
2301
  }
2302
  }
2303
 
2314
  $action_data['se_types'][$key]['terms'][] = $id;
2315
  }
2316
 
2317
+ $action_data['se_types'][$key]['actions'] = $data['actions'][$action];
2318
  }
2319
 
2320
  }