Simply Exclude - Version 1.7.9.1

Version Description

More fixes for compatibility issues with WordPress 3.1. Some of these issues reported are:

  • Simply Exclude effects the nav menus with using WP menus. http://wordpress.org/support/topic/plugin-simply-exclude-this-plugin-make-all-my-menus-totally-blank

  • Simple Exclude effect filtering of sidebar widgets OR Filter of sidebar content not effected by Simply Exclude settings. http://www.codehooligans.com/projects/wordpress/simply-exclude/#comment-82318

I'm sure there are some other areas still having issues. I'm still working on the code changes but wanted to get these fixes posts some at least some users can start using the plugin again.

Thanks to all for reporting issues and thank you for your patience in this code matter.

Download this release

Release Info

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

Code changes from version 1.7.9 to 1.7.9.1

Files changed (2) hide show
  1. readme.txt +14 -2
  2. simplyexclude.php +41 -30
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.codehooligans.com/donations/
4
  Tags: admin, posts, pages, categories, tags, exclude, include, is_front, is_archive, is_search, is_feed
5
  Requires at least: 2.8
6
  Tested up to: 3.1
7
- Stable tag: 1.7.9
8
 
9
  == Description ==
10
 
@@ -49,10 +49,22 @@ At the time (version 1.6.1) the plugin only effects Pages included in the tradit
49
 
50
  == Changelog ==
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  = 1.7.9 =
53
  Fixes some small issue which prevented this plugin from working under WordPress 3.1.
54
 
55
-
56
  = 1.7.8 =
57
  Fixes: Mainly bug fixes and code cleanup. Patched code based on reported issues with the WP Gallery shortcode and the new WP 3.0 RC1 menus
58
  Additions: Added some logic to Categories and Tags to work with Exclude/Include when using the WordPress Category or Tag Cloud Widgets.
4
  Tags: admin, posts, pages, categories, tags, exclude, include, is_front, is_archive, is_search, is_feed
5
  Requires at least: 2.8
6
  Tested up to: 3.1
7
+ Stable tag: 1.7.9.1
8
 
9
  == Description ==
10
 
49
 
50
  == Changelog ==
51
 
52
+ = 1.7.9.1 =
53
+ More fixes for compatibility issues with WordPress 3.1. Some of these issues reported are:
54
+
55
+ * Simply Exclude effects the nav menus with using WP menus. http://wordpress.org/support/topic/plugin-simply-exclude-this-plugin-make-all-my-menus-totally-blank
56
+
57
+ * Simple Exclude effect filtering of sidebar widgets OR Filter of sidebar content not effected by Simply Exclude settings.
58
+ http://www.codehooligans.com/projects/wordpress/simply-exclude/#comment-82318
59
+
60
+ I'm sure there are some other areas still having issues. I'm still working on the code changes but wanted to get these fixes posts some at least some users can start using the plugin again.
61
+
62
+ Thanks to all for reporting issues and thank you for your patience in this code matter.
63
+
64
+
65
  = 1.7.9 =
66
  Fixes some small issue which prevented this plugin from working under WordPress 3.1.
67
 
 
68
  = 1.7.8 =
69
  Fixes: Mainly bug fixes and code cleanup. Patched code based on reported issues with the WP Gallery shortcode and the new WP 3.0 RC1 menus
70
  Additions: Added some logic to Categories and Tags to work with Exclude/Include when using the WordPress Category or Tag Cloud Widgets.
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 categories, tags and page from the 4 actions used by WordPress. is_front, is_archive, is_search, is_feed, is_front.
6
  Author: Paul Menard
7
- Version: 1.7.9
8
  Author URI: http://www.codehooligans.com
9
 
10
  */
@@ -359,8 +359,7 @@ class SimplyExclude
359
  function se_install()
360
  {
361
  add_option($this->options_key,
362
- serialize($this->se_cfg),
363
- "This is the serialized config structures used.");
364
  }
365
 
366
  function se_manage_page()
@@ -640,7 +639,7 @@ class SimplyExclude
640
  $class = ('alternate' == $class) ? '' : 'alternate';
641
 
642
  if (!isset($this->se_cfg['cats']['extra']['wp_list_categories']))
643
- $this->se_cfg['cats']['extra']['wp_list_categories'] == 'No';
644
  ?>
645
  <tr <?php if (strlen($class)) echo "class='".$class."'" ?>>
646
  <td class="action">Widget</td>
@@ -1261,7 +1260,7 @@ class SimplyExclude
1261
  $action_key = "is_search";
1262
 
1263
  if ((!empty($wp_query->query_vars['s']))
1264
- && (count($this->se_cfg['pages'][$action_key]) > 0))
1265
  {
1266
  //echo __FUNCTION__ ." before : where=[".$where."]<br />";
1267
  $excl_list = $this->get_pages_list(',', $this->se_cfg['pages'][$action_key]);
@@ -1286,11 +1285,15 @@ class SimplyExclude
1286
  //echo __FUNCTION__ ." before: where=[".$where."]<br />";
1287
 
1288
  $where = str_replace('"', "'", $where);
1289
- if ('true' == $this->options['SE4_approved_pages_only']) {
1290
- $where = str_replace("post_type = 'post' AND ", "post_password = '' AND ", $where);
1291
- }
1292
- else { // < v 2.1
1293
- $where = str_replace("post_type = 'post' AND ", "", $where);
 
 
 
 
1294
  }
1295
  //echo __FUNCTION__ ." after: where=[".$where."]<br />";
1296
  }
@@ -1447,16 +1450,19 @@ class SimplyExclude
1447
  if (($wp_query->is_admin) || ($wp_query->is_single) || ($wp_query->is_page))
1448
  return $wp_query;
1449
 
 
 
 
 
 
 
1450
  // Only filter on our actions.
1451
- // if ((!is_front_page())
1452
- // && (!is_search())
1453
- // && (!is_archive())
1454
- // && (!is_feed())
1455
- // && (!is_author()) )
1456
- // return;
1457
-
1458
- //echo "se_cfg<pre>"; print_r($this->se_cfg); echo "</pre>";
1459
- // echo "default_IsActions<pre>"; print_r($this->default_IsActions); echo "</pre>";
1460
 
1461
  if (count($this->default_IsActions['cats']) > 0)
1462
  {
@@ -1480,6 +1486,7 @@ class SimplyExclude
1480
  {
1481
  if (count($this->default_IsActions['tags']) > 0)
1482
  {
 
1483
  foreach ($this->default_IsActions['tags'] as $action_key => $action_val)
1484
  {
1485
  if ($wp_query->{$action_key})
@@ -1996,19 +2003,23 @@ class SimplyExclude
1996
  if (!$all_cat_ids)
1997
  $all_cat_ids = array();
1998
 
1999
- if (($this->se_cfg['cats']['actions']['is_archive'] == 'e')
2000
- && (count($this->se_cfg['cats']['is_archive'])))
2001
  {
2002
- $all_cat_ids = array_keys($this->se_cfg['cats']['is_archive']);
2003
- }
2004
- else if (($this->se_cfg['cats']['actions']['is_archive'] == 'i')
2005
- && (count($this->se_cfg['cats']['is_archive'])))
2006
- {
2007
- foreach($this->se_cfg['cats']['is_archive'] as $c_idx => $c_item)
2008
  {
2009
- $item_idx = array_search($c_idx, $all_cat_ids);
2010
- if ($item_idx !== false)
2011
- unset($all_cat_ids[$item_idx]);
 
 
 
 
 
 
 
 
2012
  }
2013
  }
2014
 
4
  Plugin URI: http://www.codehooligans.com/projects/wordpress/simply-exclude/
5
  Description: Provides an interface to selectively exclude/include categories, tags and page from the 4 actions used by WordPress. is_front, is_archive, is_search, is_feed, is_front.
6
  Author: Paul Menard
7
+ Version: 1.7.9.1
8
  Author URI: http://www.codehooligans.com
9
 
10
  */
359
  function se_install()
360
  {
361
  add_option($this->options_key,
362
+ serialize($this->se_cfg));
 
363
  }
364
 
365
  function se_manage_page()
639
  $class = ('alternate' == $class) ? '' : 'alternate';
640
 
641
  if (!isset($this->se_cfg['cats']['extra']['wp_list_categories']))
642
+ $this->se_cfg['cats']['extra']['wp_list_categories'] = 'No';
643
  ?>
644
  <tr <?php if (strlen($class)) echo "class='".$class."'" ?>>
645
  <td class="action">Widget</td>
1260
  $action_key = "is_search";
1261
 
1262
  if ((!empty($wp_query->query_vars['s']))
1263
+ && ((isset($this->se_cfg['pages'][$action_key])) && (count($this->se_cfg['pages'][$action_key]) > 0)))
1264
  {
1265
  //echo __FUNCTION__ ." before : where=[".$where."]<br />";
1266
  $excl_list = $this->get_pages_list(',', $this->se_cfg['pages'][$action_key]);
1285
  //echo __FUNCTION__ ." before: where=[".$where."]<br />";
1286
 
1287
  $where = str_replace('"', "'", $where);
1288
+
1289
+ if (isset($this->options['SE4_approved_pages_only']))
1290
+ {
1291
+ if ('true' == $this->options['SE4_approved_pages_only']) {
1292
+ $where = str_replace("post_type = 'post' AND ", "post_password = '' AND ", $where);
1293
+ }
1294
+ else { // < v 2.1
1295
+ $where = str_replace("post_type = 'post' AND ", "", $where);
1296
+ }
1297
  }
1298
  //echo __FUNCTION__ ." after: where=[".$where."]<br />";
1299
  }
1450
  if (($wp_query->is_admin) || ($wp_query->is_single) || ($wp_query->is_page))
1451
  return $wp_query;
1452
 
1453
+ if ((isset($wp_query->query_vars['post_type']))
1454
+ && (strlen($wp_query->query_vars['post_type'])) )
1455
+ {
1456
+ return $wp_query;
1457
+ }
1458
+
1459
  // Only filter on our actions.
1460
+ if ((!$wp_query->is_home)
1461
+ && (!$wp_query->is_search)
1462
+ && (!$wp_query->is_archive)
1463
+ && (!$wp_query->is_feed)
1464
+ && (!$wp_query->is_author) )
1465
+ return $wp_query;
 
 
 
1466
 
1467
  if (count($this->default_IsActions['cats']) > 0)
1468
  {
1486
  {
1487
  if (count($this->default_IsActions['tags']) > 0)
1488
  {
1489
+ //echo "this->default_IsActions[tags]<pre>"; print_r($this->default_IsActions['tags']); echo "</pre>";
1490
  foreach ($this->default_IsActions['tags'] as $action_key => $action_val)
1491
  {
1492
  if ($wp_query->{$action_key})
2003
  if (!$all_cat_ids)
2004
  $all_cat_ids = array();
2005
 
2006
+ if ((isset($this->se_cfg['cats']['actions']['is_archive']))
2007
+ && (isset($this->se_cfg['cats']['is_archive'])))
2008
  {
2009
+ if (($this->se_cfg['cats']['actions']['is_archive'] == 'e')
2010
+ && (count($this->se_cfg['cats']['is_archive'])))
 
 
 
 
2011
  {
2012
+ $all_cat_ids = array_keys($this->se_cfg['cats']['is_archive']);
2013
+ }
2014
+ else if (($this->se_cfg['cats']['actions']['is_archive'] == 'i')
2015
+ && (count($this->se_cfg['cats']['is_archive'])))
2016
+ {
2017
+ foreach($this->se_cfg['cats']['is_archive'] as $c_idx => $c_item)
2018
+ {
2019
+ $item_idx = array_search($c_idx, $all_cat_ids);
2020
+ if ($item_idx !== false)
2021
+ unset($all_cat_ids[$item_idx]);
2022
+ }
2023
  }
2024
  }
2025