Simply Exclude - Version 2.0.6.1

Version Description

Corrected issue with reported PHP 5.4 related code. Changes settings screen to split Taxonomies, Post Types and Users into tabbed screen. Better than one long screen. Fixed issue with excluding categories on Home and Archive where it effects the pager. Note this is only for the default WordPress paging. Custom pagers may still have issue.

Download this release

Release Info

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

Code changes from version 2.0.6 to 2.0.6.1

js/simplyexclude_admin_ajax.js CHANGED
@@ -1,18 +1,15 @@
1
  jQuery(document).ready(function() {
2
 
3
  jQuery('td.column-se-actions input.se-term-input').click(function(){
4
- //alert('click');
5
  var input_name = jQuery(this).attr('name');
6
  var is_checked = jQuery(this).attr('checked');
7
- var label = jQuery(this).parent('td.column-se-actions');
 
8
 
9
 
10
  if (is_checked == 'checked') is_checked = "yes";
11
  else is_checked = "no";
12
 
13
- //alert('input_name=['+input_name+'] checked=['+is_checked+']');
14
- //se_send_update(input_name, is_checked);
15
-
16
  var data = {
17
  action: 'se_update',
18
  se_action: 'se_update_terms',
@@ -21,22 +18,26 @@ jQuery(document).ready(function() {
21
  };
22
 
23
  jQuery.post(ajaxurl, data, function(response) {
24
- if (response == "SUCCESS") // SUCCESS is yellow fade to white
25
- jQuery(label).stop().css("background-color", "#FFFF9C").animate({ backgroundColor: "#FFFFFF"}, 1500);
26
- else // On !SUCCESS is red fade to white
27
- jQuery(label).stop().css("background-color", "#FF0000").animate({ backgroundColor: "#FFFFFF"}, 1500);
 
 
 
 
 
 
28
  });
29
  });
30
 
31
  //jQuery('table.simplyexclude-actions-panel input[type="radio"]').click(function(){
32
  jQuery('table.simply-exclude-settings-postbox input[type="radio"]').click(function(){
33
 
34
- //alert('click');
35
  var input_name = jQuery(this).attr('name');
36
  var value = jQuery(this).attr('value');
37
- var label = jQuery(this).parent('td.inc-excl');
38
-
39
- //alert("input_name=["+input_name+"] value=["+value+"]");
40
 
41
  var data = {
42
  action: 'se_update',
@@ -46,10 +47,12 @@ jQuery(document).ready(function() {
46
  };
47
 
48
  jQuery.post(ajaxurl, data, function(response) {
 
 
49
  if (response == "SUCCESS") // SUCCESS is yellow fade to white
50
- jQuery(label).stop().css("background-color", "#FFFF9C").animate({ backgroundColor: "#FFFFFF"}, 1500);
51
  else // On !SUCCESS is red fade to white
52
- jQuery(label).stop().css("background-color", "#FF0000").animate({ backgroundColor: "#FFFFFF"}, 1500);
53
  });
54
  });
55
 
1
  jQuery(document).ready(function() {
2
 
3
  jQuery('td.column-se-actions input.se-term-input').click(function(){
 
4
  var input_name = jQuery(this).attr('name');
5
  var is_checked = jQuery(this).attr('checked');
6
+ //var label = jQuery(this).parents('td.column-se-actions');
7
+ var label = jQuery(this).next('label');
8
 
9
 
10
  if (is_checked == 'checked') is_checked = "yes";
11
  else is_checked = "no";
12
 
 
 
 
13
  var data = {
14
  action: 'se_update',
15
  se_action: 'se_update_terms',
18
  };
19
 
20
  jQuery.post(ajaxurl, data, function(response) {
21
+ var label_background_color = jQuery(label).css('background-color');
22
+ if (response == "SUCCESS") { // SUCCESS is yellow fade to white
23
+ jQuery(label).stop().css("background-color", "#FFFF9C").animate({ backgroundColor: label_background_color}, 1500, 'swing', function(){
24
+ jQuery(label).css('background-color', label_background_color);
25
+ });
26
+ } else { // On !SUCCESS is red fade to white
27
+ jQuery(label).stop().css("background-color", "#FF0000").animate({ backgroundColor: label_background_color}, 1500, 'swing', function(){
28
+ jQuery(label).css('background-color', label_background_color);
29
+ });
30
+ }
31
  });
32
  });
33
 
34
  //jQuery('table.simplyexclude-actions-panel input[type="radio"]').click(function(){
35
  jQuery('table.simply-exclude-settings-postbox input[type="radio"]').click(function(){
36
 
 
37
  var input_name = jQuery(this).attr('name');
38
  var value = jQuery(this).attr('value');
39
+ var label = jQuery(this).parents('td.inc-excl');
40
+ //var label = jQuery(this).next('label');
 
41
 
42
  var data = {
43
  action: 'se_update',
47
  };
48
 
49
  jQuery.post(ajaxurl, data, function(response) {
50
+ var label_background_color = jQuery(label).css('background-color');
51
+
52
  if (response == "SUCCESS") // SUCCESS is yellow fade to white
53
+ jQuery(label).stop().css("background-color", "#FFFF9C").animate({ backgroundColor: label_background_color}, 1500);
54
  else // On !SUCCESS is red fade to white
55
+ jQuery(label).stop().css("background-color", "#FF0000").animate({ backgroundColor: label_background_color}, 1500);
56
  });
57
  });
58
 
readme.txt CHANGED
@@ -1,10 +1,12 @@
1
  === Simply Exclude ===
2
- Contributors: Paul Menard
3
  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.6
 
 
8
 
9
  == Description ==
10
 
@@ -48,6 +50,11 @@ At the time (version 1.6.1) the plugin only effects Pages included in the tradit
48
 
49
  == Changelog ==
50
 
 
 
 
 
 
51
  = 2.0.6 =
52
  2013-03-20
53
  Bug fixes for Illegal string offset 'action' PHP Warnings.
1
  === Simply Exclude ===
2
+ Contributors: pmenard
3
  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.7
6
+ Tested up to: 3.9
7
+ Stable tag: 2.0.6.1
8
+ License: GPLv2
9
+ License URI: http://www.opensource.org/licenses/GPL-2.0
10
 
11
  == Description ==
12
 
50
 
51
  == Changelog ==
52
 
53
+ = 2.0.6.1 =
54
+ Corrected issue with reported PHP 5.4 related code.
55
+ Changes settings screen to split Taxonomies, Post Types and Users into tabbed screen. Better than one long screen.
56
+ Fixed issue with excluding categories on Home and Archive where it effects the pager. Note this is only for the default WordPress paging. Custom pagers may still have issue.
57
+
58
  = 2.0.6 =
59
  2013-03-20
60
  Bug fixes for Illegal string offset 'action' PHP Warnings.
simplyexclude.php CHANGED
@@ -4,27 +4,8 @@ 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.6
8
  Author URI: http://www.codehooligans.com
9
-
10
- Revision history
11
- 1.0 - 2007-11-20: Initial release
12
- 1.1 - 2008-12-15: Added logic to work with WP version greater than 2.2
13
- 1.5 - 20008-04-27 Fixed display issues. Changes 'List' to 'Archive'. Added tags inclusion/exclusion login. Works only with WP 2.3 and greater.
14
- 1.6 - 2008-05-22 Fixed various items. Added format display for Categories and Pages to reveal heirarchy, Disable plugin functions when searching in admin. This also corrected a display exclusion bug when showing categories and pages.
15
- 1.7 - 2008-05-29 Added Author to the Include/Exclude logic. Now you can exclude Author's Posts from Search, Home, RSS, Archive.
16
- 1.7.1 - 2008-07-16 Fixed an issue with WP 2.6 where it automatically decided to unserialize the option data structure.
17
- 1.7.2 - 2009-02-05 Fixed some PHP warning by checking variable is set. Also added style to 2.7 interface.
18
- 1.7.2.1 - 2009-07-01 Fixed some PHP warning by checking variable is set. Also added style for 2.8 interface. Very minor changes.
19
- 1.7.5 - 2009-07015 Fixed some PHP warning by checking variable is set. Also added style for 2.8 interface. Very minor changes.
20
- 1.7.6 - 2009-11-14 Fixes: Issue with the Pages exclusion. Many users reporting a permissions issue. Additions: Added handler logic to interface with two other plugins. One of the often used Google XML Sitemaps. When setting Page or Category exclusions you now have the option to update the Google XML Sitemaps exclude pages and categories automatically. The other plugin is Search Unleashed.
21
- 2.0 - 2012-03-03 Full rewrite of the plugin to support custom Taxonomies and Custom Post Types. Added support for managing items within the Taxonomy/Post Type panels. Added support for exclude/include on Post instead of just Categories and Tags. Dropped support for third-party plugins like Google XML Sitemaps and Seach Unleashed (Sorry!). Now correctly supporting Pages seach excludes. Yah!.
22
- 2.0.1 - 2012-03-04 Small bug. On the new Simply Exclude Help panel I user the jQuery UI Accordion package. Seems I failed to check this when setting the minimum WordPress version I was supporting (3.2). Seems jQuery UI Accordion is not available in core WordPress until version 3.3. So have added my own libraries to cover the older versions of WordPress. Sorry about that. And thanks to @biswajeet for bringing this up in the WordPress forums.
23
- 2.0.2 - 2012-03-05 Fixed some issues when converting from the previous version of the Simply Exclude configurations.
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');
@@ -46,9 +27,12 @@ class SimplyExclude
46
 
47
  private $page_hooks;
48
 
 
 
 
49
  public function __construct() {
50
 
51
- $this->se_version = "2.0.3";
52
 
53
  $this->admin_menu_label = __("Simply Exclude", SIMPLY_EXCLUDE_I18N_DOMAIN);
54
  $this->options_key = "simplyexclude_v2";
@@ -75,6 +59,14 @@ class SimplyExclude
75
 
76
  function admin_init_proc()
77
  {
 
 
 
 
 
 
 
 
78
  $this->se_load_config();
79
 
80
  if ( ($this->check_url('wp-admin/edit-tags.php'))
@@ -229,31 +221,21 @@ class SimplyExclude
229
  wp_enqueue_script('wp-lists');
230
  wp_enqueue_script('postbox');
231
 
232
- //add several metaboxes now, all metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
 
 
 
 
 
 
 
 
 
233
  add_meta_box('se_settings_about_sidebar', 'About this Plugin', array(&$this, 'se_settings_about_sidebar'),
234
  $this->pagehooks['se_manage_settings'], 'side', 'core');
235
  add_meta_box('se_settings_donate_sidebar', 'Make a Donation', array(&$this, 'se_settings_donate_sidebar'),
236
  $this->pagehooks['se_manage_settings'], 'side', 'core');
237
 
238
- add_meta_box('se_display_options_taxonomy_actions_panel', 'Taxonomies Actions', array(&$this, 'se_display_options_taxonomy_actions_panel'),
239
- $this->pagehooks['se_manage_settings'], 'normal', 'core');
240
-
241
- add_meta_box('se_display_options_post_type_actions_panel', 'Post Types Actions', array(&$this, 'se_display_options_post_type_actions_panel'),
242
- $this->pagehooks['se_manage_settings'], 'normal', 'core');
243
-
244
- add_meta_box('se_display_options_user_actions_panel', 'Users Actions', array(&$this, 'se_display_options_user_actions_panel'),
245
- $this->pagehooks['se_manage_settings'], 'normal', 'core');
246
-
247
- // add_meta_box('se_options_thirdparty_panel', 'Other Plugins', array(&$this, 'se_options_thirdparty_panel'),
248
- // $this->pagehooks['se_manage_settings'], 'normal', 'core');
249
-
250
- // Check if there is an older version of the SE configuration.
251
- $tmp_se_cfg = get_option('simplyexclude');
252
- if ($tmp_se_cfg) {
253
- add_meta_box('se_display_configuration_reload_actions_panel', 'Reload Previous Configuration', array(&$this, 'se_display_configuration_reload_actions_panel'),
254
- $this->pagehooks['se_manage_settings'], 'normal', 'core');
255
- }
256
-
257
  }
258
 
259
  function on_load_help_page()
@@ -320,10 +302,9 @@ class SimplyExclude
320
  <td class="action"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'name'); //$action_val['name'] ?></td>
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
@@ -363,29 +344,21 @@ class SimplyExclude
363
  <td class="action"><?php echo $this->get_post_type_action_label($post_type, $action_key, 'name'); ?></td>
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
-
380
- else if (($action_key == "is_feed")
381
- && ((isset($this->current_post_type['options']['capability_type'])) && ($this->current_post_type['options']['capability_type'] == "post")))
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
- ?>
389
  </td>
390
  <tr>
391
  <?php
@@ -425,10 +398,9 @@ class SimplyExclude
425
  <td class="action"><?php echo $this->get_se_type_action_label($se_type, $action_key, 'name'); ?></td>
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
@@ -898,10 +870,11 @@ class SimplyExclude
898
 
899
  if ((isset($this->current_taxonomy['actions'])) && (count($this->current_taxonomy['actions'])))
900
  {
 
901
  foreach ($this->current_taxonomy['actions'] as $action_key => $action_val)
902
  {
903
  ?>
904
- <input type="checkbox"
905
  name="se_cfg[<?php echo $taxonomy; ?>][terms][<?php echo $action_key ?>][<?php echo $term->term_id ?>]"
906
  id="<?php echo $taxonomy; ?>-<?php echo $action_key ?>-<?php echo $term->term_id ?>" class="se-term-input"
907
  <?php
@@ -909,10 +882,11 @@ class SimplyExclude
909
  && ($this->current_taxonomy['terms'][$action_key][$term->term_id] == "on"))
910
  echo "checked='checked' ";
911
  ?> />&nbsp;<label for="<?php echo $taxonomy; ?>-<?php echo $action_key ?>-<?php echo $term->term_id ?>"
912
- class="se-term-label"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'name'); ?></label><br />
913
 
914
  <?php
915
  }
 
916
  }
917
  }
918
  }
@@ -926,10 +900,10 @@ class SimplyExclude
926
 
927
  if ((isset($this->current_post_type['actions'])) && (count($this->current_post_type['actions'])))
928
  {
 
929
  foreach ($this->current_post_type['actions'] as $action_key => $action_val)
930
  {
931
- ?>
932
- <input type="checkbox"
933
  name="se_cfg[<?php echo $post_type; ?>][terms][<?php echo $action_key ?>][<?php echo $p_item->ID ?>]"
934
  id="<?php echo $post_type; ?>-<?php echo $action_key ?>-<?php echo $p_item->ID ?>" class="se-term-input"
935
  <?php
@@ -938,10 +912,11 @@ class SimplyExclude
938
  && ($this->current_post_type['terms'][$action_key][$p_item->ID] == "on"))
939
  echo "checked='checked' ";
940
  ?> />&nbsp;<label for="<?php echo $post_type; ?>-<?php echo $action_key ?>-<?php echo $p_item->ID ?>">
941
- <?php echo $this->get_post_type_action_label($post_type, $action_key, 'name') ?></label><br />
942
 
943
  <?php
944
  }
 
945
  }
946
  }
947
  }
@@ -955,10 +930,10 @@ class SimplyExclude
955
 
956
  if ((isset($this->current_se_type['actions'])) && (count($this->current_se_type['actions'])))
957
  {
 
958
  foreach ($this->current_se_type['actions'] as $action_key => $action_val)
959
  {
960
- ?>
961
- <input type="checkbox"
962
  name="se_cfg[<?php echo $se_type; ?>][terms][<?php echo $action_key ?>][<?php echo $user->ID ?>]"
963
  id="<?php echo $se_type; ?>-<?php echo $action_key ?>-<?php echo $user->ID ?>" class="se-term-input"
964
  <?php
@@ -967,10 +942,11 @@ class SimplyExclude
967
  && ($this->current_se_type['terms'][$action_key][$user->ID] == "on"))
968
  echo "checked='checked' ";
969
  ?> />&nbsp;<label for="<?php echo $se_type; ?>-<?php echo $action_key ?>-<?php echo $user->ID ?>">
970
- <?php echo $this->get_se_type_action_label($se_type, $action_key, 'name') ?></label><br />
971
 
972
  <?php
973
  }
 
974
  }
975
  }
976
  }
@@ -2689,8 +2665,7 @@ class SimplyExclude
2689
  {
2690
  $arg_parts[$idx] = str_replace(']', '', $val);
2691
  }
2692
- //echo "arg_parts<pre>"; print_r($arg_parts); echo "</pre>";
2693
-
2694
  if ($arg_parts[1] == "users")
2695
  {
2696
  $se_type = $arg_parts[1];
@@ -2702,10 +2677,7 @@ class SimplyExclude
2702
  if (!isset($this->se_cfg['data']['se_types'][$se_type][$option]))
2703
  $this->se_cfg['data']['se_types'][$se_type][$option] = array();
2704
 
2705
- if (!isset($this->se_cfg['data']['se_types'][$se_type][$option][$action]))
2706
- $this->se_cfg['data']['se_types'][$se_type][$option][$action] = array();
2707
-
2708
- $this->se_cfg['data']['se_types'][$se_type][$option][$action]['action'] = $is_checked;
2709
  }
2710
  else if ($option == "options")
2711
  {
@@ -2727,10 +2699,7 @@ class SimplyExclude
2727
  if (!isset($this->se_cfg['data']['post_types'][$post_type][$option]))
2728
  $this->se_cfg['data']['post_types'][$post_type][$option] = array();
2729
 
2730
- if (!isset($this->se_cfg['data']['post_types'][$post_type][$option][$action]))
2731
- $this->se_cfg['data']['post_types'][$post_type][$option][$action] = array();
2732
-
2733
- $this->se_cfg['data']['post_types'][$post_type][$option][$action]['action'] = $is_checked;
2734
  }
2735
  else if ($option == "options")
2736
  {
@@ -2751,10 +2720,7 @@ class SimplyExclude
2751
  if (!isset($this->se_cfg['data']['taxonomies'][$taxonomy][$option]))
2752
  $this->se_cfg['data']['taxonomies'][$taxonomy][$option] = array();
2753
 
2754
- if (!isset($this->se_cfg['data']['taxonomies'][$taxonomy][$option][$action]))
2755
- $this->se_cfg['data']['taxonomies'][$taxonomy][$option][$action] = array();
2756
-
2757
- $this->se_cfg['data']['taxonomies'][$taxonomy][$option][$action]['action'] = $is_checked;
2758
  }
2759
  else if ($option == "options")
2760
  {
@@ -2769,12 +2735,6 @@ class SimplyExclude
2769
  die(); // this is required to return a proper result
2770
  }
2771
 
2772
-
2773
-
2774
-
2775
-
2776
-
2777
-
2778
  function display_instructions($item)
2779
  {
2780
  switch ($item) {
@@ -2816,16 +2776,48 @@ class SimplyExclude
2816
  {
2817
  ?>
2818
  <div id="howto-se-manage-settings-metaboxes-general" class="wrap">
2819
- <?php screen_icon('options-general'); ?>
2820
- <h2><?php _ex("Simply Exclude Manage Settings", "Options Page Title", SIMPLY_EXCLUDE_I18N_DOMAIN); ?></h2>
 
 
 
 
 
 
2821
 
2822
- <div id="poststuff" class="metabox-holder has-right-sidebar simnplyexclude-metabox-holder-right-sidebar">
2823
  <div id="side-info-column" class="inner-sidebar">
2824
  <?php do_meta_boxes($this->pagehooks['se_manage_settings'], 'side', ''); ?>
2825
  </div>
2826
  <div id="post-body" class="has-sidebar ">
2827
- <div id="post-body-content" class="has-sidebar-content simnplyexclude-metabox-holder-main">
2828
- <?php do_meta_boxes($this->pagehooks['se_manage_settings'], 'normal', ''); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2829
  </div>
2830
  </div>
2831
  </div>
@@ -2851,11 +2843,19 @@ class SimplyExclude
2851
  {
2852
  foreach($se_taxonomies as $key => $taxonomy)
2853
  {
2854
- ?><h4 class="simplyexclude-section-title"><?php echo $taxonomy->labels->name; ?> (<?php echo $key; ?>)</h4><?php
2855
- $this->se_show_taxonomy_active_panel($taxonomy->name);
2856
- $this->se_show_taxonomy_actions_panel($taxonomy->name);
2857
- $this->se_show_taxonomy_showhide_panel($taxonomy->name);
2858
- $this->se_show_taxonomy_query_override_panel($taxonomy->name);
 
 
 
 
 
 
 
 
2859
  }
2860
  }
2861
  }
@@ -2868,12 +2868,19 @@ class SimplyExclude
2868
  {
2869
  foreach($se_post_types as $key => $post_type)
2870
  {
2871
- ?><h4 class="simplyexclude-section-title"><?php echo $post_type->labels->name; ?> (<?php echo $key; ?>)</h4><?php
2872
- $this->se_show_post_type_active_panel($post_type->name);
2873
- $this->se_show_post_type_actions_panel($post_type->name);
2874
- $this->se_show_post_type_showhide_panel($post_type->name);
2875
- $this->se_show_post_type_query_override_panel($post_type->name);
2876
-
 
 
 
 
 
 
 
2877
  }
2878
  }
2879
  }
@@ -2881,11 +2888,19 @@ class SimplyExclude
2881
  function se_display_options_user_actions_panel()
2882
  {
2883
  $this->display_instructions('users');
2884
- ?><h4 class="simplyexclude-section-title">Users</h4><?php
2885
- $this->se_show_se_type_active_panel('users');
2886
- $this->se_show_se_type_actions_panel('users');
2887
- $this->se_show_se_type_showhide_panel('users');
2888
- $this->se_show_se_type_query_override_panel('users');
 
 
 
 
 
 
 
 
2889
  }
2890
 
2891
  function se_display_configuration_reload_actions_panel() {
@@ -3001,12 +3016,12 @@ class SimplyExclude
3001
  <?php screen_icon('options-general'); ?>
3002
  <h2><?php _ex("Simply Exclude Help", "Options Page Title", SIMPLY_EXCLUDE_I18N_DOMAIN); ?></h2>
3003
 
3004
- <div id="poststuff" class="metabox-holder has-right-sidebar simnplyexclude-metabox-holder-right-sidebar">
3005
  <div id="side-info-column" class="inner-sidebar">
3006
  <?php do_meta_boxes($this->pagehooks['se_manage_help'], 'side', ''); ?>
3007
  </div>
3008
  <div id="post-body" class="has-sidebar ">
3009
- <div id="post-body-content" class="has-sidebar-content simnplyexclude-metabox-holder-main">
3010
  <?php //do_meta_boxes($this->pagehooks['se_manage_help'], 'normal', ''); ?>
3011
  <?php $this->se_settings_help_faq_topics(); ?>
3012
  </div>
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.1
8
  Author URI: http://www.codehooligans.com
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  */
10
 
11
  define('SIMPLY_EXCLUDE_I18N_DOMAIN', 'simplyexclude');
27
 
28
  private $page_hooks;
29
 
30
+ private $tabs = array();
31
+ private $current_tab;
32
+
33
  public function __construct() {
34
 
35
+ $this->se_version = "2.0.6.1";
36
 
37
  $this->admin_menu_label = __("Simply Exclude", SIMPLY_EXCLUDE_I18N_DOMAIN);
38
  $this->options_key = "simplyexclude_v2";
59
 
60
  function admin_init_proc()
61
  {
62
+
63
+ $this->tabs = array(
64
+ 'taxonomies' => __('Taxonomies', SIMPLY_EXCLUDE_I18N_DOMAIN),
65
+ 'post_types' => __('Post Types', SIMPLY_EXCLUDE_I18N_DOMAIN),
66
+ 'users' => __('Users', SIMPLY_EXCLUDE_I18N_DOMAIN),
67
+ );
68
+ $this->current_tab = '';
69
+
70
  $this->se_load_config();
71
 
72
  if ( ($this->check_url('wp-admin/edit-tags.php'))
221
  wp_enqueue_script('wp-lists');
222
  wp_enqueue_script('postbox');
223
 
224
+ if ( isset( $_GET['tab'] )) {
225
+ $this->current_tab = esc_attr($_GET['tab']);
226
+ if (!isset($this->tabs[$this->current_tab])) {
227
+ $this->current_tab = 'taxonomies';
228
+ }
229
+
230
+ } else {
231
+ $this->current_tab = 'taxonomies';
232
+ }
233
+
234
  add_meta_box('se_settings_about_sidebar', 'About this Plugin', array(&$this, 'se_settings_about_sidebar'),
235
  $this->pagehooks['se_manage_settings'], 'side', 'core');
236
  add_meta_box('se_settings_donate_sidebar', 'Make a Donation', array(&$this, 'se_settings_donate_sidebar'),
237
  $this->pagehooks['se_manage_settings'], 'side', 'core');
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  }
240
 
241
  function on_load_help_page()
302
  <td class="action"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'name'); //$action_val['name'] ?></td>
303
  <td class="description"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'description');//$action_val['description'] ?></td>
304
  <td class="inc-excl">
305
+ <ul class="se-actions-list">
306
+ <li><input type="radio" id="se_cfg_<?php echo $taxonomy; ?>_actions_<?php echo $action_key ?>_i" name="se_cfg[<?php echo $taxonomy; ?>][actions][<?php echo $action_key ?>]" value="i" <?php if ($action_val == 'i') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $taxonomy; ?>_actions_<?php echo $action_key ?>_i"><?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li>
307
+ <li><input type="radio" id="se_cfg_<?php echo $taxonomy; ?>_actions_<?php echo $action_key ?>_e" name="se_cfg[<?php echo $taxonomy; ?>][actions][<?php echo $action_key ?>]" value="e" <?php if ($action_val == 'e') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $taxonomy; ?>_actions_<?php echo $action_key ?>_e"><?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li>
 
308
  </td>
309
  <tr>
310
  <?php
344
  <td class="action"><?php echo $this->get_post_type_action_label($post_type, $action_key, 'name'); ?></td>
345
  <td class="description"><?php echo $this->get_post_type_action_label($post_type, $action_key, 'description'); ?></td>
346
  <td class="inc-excl">
347
+ <ul class="se-actions-list">
348
+
349
+ <li><input type="radio" id="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_i" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="i" <?php if ($action_val == 'i') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_i"><?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li>
350
+ <li><input type="radio" id="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_e" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="e" <?php if ($action_val == 'e') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_e"><?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li>
351
+ <?php
352
+ if (($action_key == "is_home")
353
+ && ((isset($this->current_post_type['options']['capability_type']))
354
+ && ($this->current_post_type['options']['capability_type'] == "post"))) {
355
+ ?><li><input type="radio" id="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_a" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="a" <?php if ($action_val == 'a') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_a"><?php _e('Include All', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li><?php
356
+ } else if (($action_key == "is_feed")
357
+ && ((isset($this->current_post_type['options']['capability_type']))
358
+ && ($this->current_post_type['options']['capability_type'] == "post"))) {
359
+ ?><li><input type="radio" id="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_a" name="se_cfg[<?php echo $post_type; ?>][actions][<?php echo $action_key ?>]" value="a" <?php if ($action_val == 'a') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $post_type ?>_actions_<?php echo $action_key ?>_a"><?php _e('Include All', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li><?php
360
+ }
361
+ ?>
 
 
 
 
 
 
 
 
362
  </td>
363
  <tr>
364
  <?php
398
  <td class="action"><?php echo $this->get_se_type_action_label($se_type, $action_key, 'name'); ?></td>
399
  <td class="description"><?php echo $this->get_se_type_action_label($se_type, $action_key, 'description'); ?></td>
400
  <td class="inc-excl">
401
+ <ul class="se-actions-list">
402
+ <li><input type="radio" id="se_cfg_<?php echo $se_type; ?>_actions_<?php echo $action_key ?>_i" name="se_cfg[<?php echo $se_type; ?>][actions][<?php echo $action_key ?>]" value="i" <?php if ($action_val == 'i') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $se_type; ?>_actions_<?php echo $action_key ?>_i"><?php _e('Include only', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li>
403
+ <li><input type="radio" id="se_cfg_<?php echo $se_type; ?>_actions_<?php echo $action_key ?>_e" name="se_cfg[<?php echo $se_type; ?>][actions][<?php echo $action_key ?>]" value="e" <?php if ($action_val == 'e') echo "checked='checked'"; ?> /> <label for="se_cfg_<?php echo $se_type; ?>_actions_<?php echo $action_key ?>_e"><?php _e('Exclude', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></label></li>
 
404
  </td>
405
  <tr>
406
  <?php
870
 
871
  if ((isset($this->current_taxonomy['actions'])) && (count($this->current_taxonomy['actions'])))
872
  {
873
+ ?><ul class="se-actions-list"><?php
874
  foreach ($this->current_taxonomy['actions'] as $action_key => $action_val)
875
  {
876
  ?>
877
+ <li><input type="checkbox"
878
  name="se_cfg[<?php echo $taxonomy; ?>][terms][<?php echo $action_key ?>][<?php echo $term->term_id ?>]"
879
  id="<?php echo $taxonomy; ?>-<?php echo $action_key ?>-<?php echo $term->term_id ?>" class="se-term-input"
880
  <?php
882
  && ($this->current_taxonomy['terms'][$action_key][$term->term_id] == "on"))
883
  echo "checked='checked' ";
884
  ?> />&nbsp;<label for="<?php echo $taxonomy; ?>-<?php echo $action_key ?>-<?php echo $term->term_id ?>"
885
+ class="se-term-label"><?php echo $this->get_taxonomy_action_label($taxonomy, $action_key, 'name'); ?></label></li>
886
 
887
  <?php
888
  }
889
+ ?></ul><?php
890
  }
891
  }
892
  }
900
 
901
  if ((isset($this->current_post_type['actions'])) && (count($this->current_post_type['actions'])))
902
  {
903
+ ?><ul class="se-actions-list"><?php
904
  foreach ($this->current_post_type['actions'] as $action_key => $action_val)
905
  {
906
+ ?><li><input type="checkbox"
 
907
  name="se_cfg[<?php echo $post_type; ?>][terms][<?php echo $action_key ?>][<?php echo $p_item->ID ?>]"
908
  id="<?php echo $post_type; ?>-<?php echo $action_key ?>-<?php echo $p_item->ID ?>" class="se-term-input"
909
  <?php
912
  && ($this->current_post_type['terms'][$action_key][$p_item->ID] == "on"))
913
  echo "checked='checked' ";
914
  ?> />&nbsp;<label for="<?php echo $post_type; ?>-<?php echo $action_key ?>-<?php echo $p_item->ID ?>">
915
+ <?php echo $this->get_post_type_action_label($post_type, $action_key, 'name') ?></label></li>
916
 
917
  <?php
918
  }
919
+ ?></ul><?php
920
  }
921
  }
922
  }
930
 
931
  if ((isset($this->current_se_type['actions'])) && (count($this->current_se_type['actions'])))
932
  {
933
+ ?><ul class="se-actions-list"><?php
934
  foreach ($this->current_se_type['actions'] as $action_key => $action_val)
935
  {
936
+ ?><li><input type="checkbox"
 
937
  name="se_cfg[<?php echo $se_type; ?>][terms][<?php echo $action_key ?>][<?php echo $user->ID ?>]"
938
  id="<?php echo $se_type; ?>-<?php echo $action_key ?>-<?php echo $user->ID ?>" class="se-term-input"
939
  <?php
942
  && ($this->current_se_type['terms'][$action_key][$user->ID] == "on"))
943
  echo "checked='checked' ";
944
  ?> />&nbsp;<label for="<?php echo $se_type; ?>-<?php echo $action_key ?>-<?php echo $user->ID ?>">
945
+ <?php echo $this->get_se_type_action_label($se_type, $action_key, 'name') ?></label></li>
946
 
947
  <?php
948
  }
949
+ ?></ul><?php
950
  }
951
  }
952
  }
2665
  {
2666
  $arg_parts[$idx] = str_replace(']', '', $val);
2667
  }
2668
+
 
2669
  if ($arg_parts[1] == "users")
2670
  {
2671
  $se_type = $arg_parts[1];
2677
  if (!isset($this->se_cfg['data']['se_types'][$se_type][$option]))
2678
  $this->se_cfg['data']['se_types'][$se_type][$option] = array();
2679
 
2680
+ $this->se_cfg['data']['se_types'][$se_type][$option][$action] = $is_checked;
 
 
 
2681
  }
2682
  else if ($option == "options")
2683
  {
2699
  if (!isset($this->se_cfg['data']['post_types'][$post_type][$option]))
2700
  $this->se_cfg['data']['post_types'][$post_type][$option] = array();
2701
 
2702
+ $this->se_cfg['data']['post_types'][$post_type][$option][$action] = $is_checked;
 
 
 
2703
  }
2704
  else if ($option == "options")
2705
  {
2720
  if (!isset($this->se_cfg['data']['taxonomies'][$taxonomy][$option]))
2721
  $this->se_cfg['data']['taxonomies'][$taxonomy][$option] = array();
2722
 
2723
+ $this->se_cfg['data']['taxonomies'][$taxonomy][$option][$action] = $is_checked;
 
 
 
2724
  }
2725
  else if ($option == "options")
2726
  {
2735
  die(); // this is required to return a proper result
2736
  }
2737
 
 
 
 
 
 
 
2738
  function display_instructions($item)
2739
  {
2740
  switch ($item) {
2776
  {
2777
  ?>
2778
  <div id="howto-se-manage-settings-metaboxes-general" class="wrap">
2779
+ <?php screen_icon('options-general'); ?>
2780
+ <h2><?php //_ex("Simply Exclude Manage Settings", "Options Page Title", SIMPLY_EXCLUDE_I18N_DOMAIN);
2781
+ foreach( $this->tabs as $tab => $name ){
2782
+
2783
+ $class = ( $tab == $this->current_tab ) ? ' nav-tab-active' : '';
2784
+ echo "<a class='nav-tab$class' href='?page=se_manage_settings&tab=$tab'>$name</a>";
2785
+ }
2786
+ ?></h2>
2787
 
2788
+ <div id="poststuff" class="metabox-holder has-right-sidebar simplyexclude-metabox-holder-right-sidebar">
2789
  <div id="side-info-column" class="inner-sidebar">
2790
  <?php do_meta_boxes($this->pagehooks['se_manage_settings'], 'side', ''); ?>
2791
  </div>
2792
  <div id="post-body" class="has-sidebar ">
2793
+ <div id="post-body-content" class="has-sidebar-content simplyexclude-metabox-holder-main">
2794
+ <?php //do_meta_boxes($this->pagehooks['se_manage_settings'], 'normal', ''); ?>
2795
+ <?php
2796
+ switch ( $this->current_tab ) {
2797
+
2798
+ case 'post_types':
2799
+ //add_meta_box('se_display_options_post_type_actions_panel', 'Post Types Actions',
2800
+ // array(&$this, 'se_display_options_post_type_actions_panel'),
2801
+ // $this->pagehooks['se_manage_settings'], 'normal', 'core');
2802
+ $this->se_display_options_post_type_actions_panel();
2803
+ break;
2804
+
2805
+ case 'users':
2806
+ //add_meta_box('se_display_options_user_actions_panel', 'Users Actions', array(&$this, 'se_display_options_user_actions_panel'),
2807
+ // $this->pagehooks['se_manage_settings'], 'normal', 'core');
2808
+ $this->se_display_options_user_actions_panel();
2809
+ break;
2810
+
2811
+ case 'taxonomies':
2812
+ default:
2813
+ //add_meta_box('se_display_options_taxonomy_actions_panel', 'Taxonomies Actions',
2814
+ // array(&$this, 'se_display_options_taxonomy_actions_panel'),
2815
+ // $this->pagehooks['se_manage_settings'], 'normal', 'core');
2816
+ $this->se_display_options_taxonomy_actions_panel();
2817
+ break;
2818
+ }
2819
+ ?>
2820
+
2821
  </div>
2822
  </div>
2823
  </div>
2843
  {
2844
  foreach($se_taxonomies as $key => $taxonomy)
2845
  {
2846
+ ?>
2847
+ <div class="postbox">
2848
+ <h3 class="simplyexclude-section-title"><?php echo $taxonomy->labels->name; ?> (<?php echo $key; ?>)</h3>
2849
+ <div class="inside">
2850
+ <?php
2851
+ $this->se_show_taxonomy_active_panel($taxonomy->name);
2852
+ $this->se_show_taxonomy_actions_panel($taxonomy->name);
2853
+ $this->se_show_taxonomy_showhide_panel($taxonomy->name);
2854
+ $this->se_show_taxonomy_query_override_panel($taxonomy->name);
2855
+ ?>
2856
+ </div>
2857
+ </div>
2858
+ <?php
2859
  }
2860
  }
2861
  }
2868
  {
2869
  foreach($se_post_types as $key => $post_type)
2870
  {
2871
+ ?>
2872
+ <div class="postbox">
2873
+ <h3 class="simplyexclude-section-title"><?php echo $post_type->labels->name; ?> (<?php echo $key; ?>)</h3>
2874
+ <div class="inside">
2875
+ <?php
2876
+ $this->se_show_post_type_active_panel($post_type->name);
2877
+ $this->se_show_post_type_actions_panel($post_type->name);
2878
+ $this->se_show_post_type_showhide_panel($post_type->name);
2879
+ $this->se_show_post_type_query_override_panel($post_type->name);
2880
+ ?>
2881
+ </div>
2882
+ </div>
2883
+ <?php
2884
  }
2885
  }
2886
  }
2888
  function se_display_options_user_actions_panel()
2889
  {
2890
  $this->display_instructions('users');
2891
+ ?>
2892
+ <div class="postbox">
2893
+ <h3 class="simplyexclude-section-title"><?php _e('Users', SIMPLY_EXCLUDE_I18N_DOMAIN); ?></h3>
2894
+ <div class="inside">
2895
+ <?php
2896
+ $this->se_show_se_type_active_panel('users');
2897
+ $this->se_show_se_type_actions_panel('users');
2898
+ $this->se_show_se_type_showhide_panel('users');
2899
+ $this->se_show_se_type_query_override_panel('users');
2900
+ ?>
2901
+ </div>
2902
+ </div>
2903
+ <?php
2904
  }
2905
 
2906
  function se_display_configuration_reload_actions_panel() {
3016
  <?php screen_icon('options-general'); ?>
3017
  <h2><?php _ex("Simply Exclude Help", "Options Page Title", SIMPLY_EXCLUDE_I18N_DOMAIN); ?></h2>
3018
 
3019
+ <div id="poststuff" class="metabox-holder has-right-sidebar simplyexclude-metabox-holder-right-sidebar">
3020
  <div id="side-info-column" class="inner-sidebar">
3021
  <?php do_meta_boxes($this->pagehooks['se_manage_help'], 'side', ''); ?>
3022
  </div>
3023
  <div id="post-body" class="has-sidebar ">
3024
+ <div id="post-body-content" class="has-sidebar-content simplyexclude-metabox-holder-main">
3025
  <?php //do_meta_boxes($this->pagehooks['se_manage_help'], 'normal', ''); ?>
3026
  <?php $this->se_settings_help_faq_topics(); ?>
3027
  </div>
simplyexclude_style_admin.css CHANGED
@@ -33,6 +33,22 @@ table.simplyexclude-active-panel td.inc-excl {
33
  margin-bottom: 5px;
34
  }
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  .ui-accordion-header {
37
  border-top-left-radius: 3px;
38
  border-top-right-radius: 3px;
33
  margin-bottom: 5px;
34
  }
35
 
36
+ td.column-se-actions ul.se-actions-list,
37
+ td.inc-excl ul.se-actions-list {
38
+ margin: 0;
39
+ padding: 0;
40
+ list-style: none;
41
+ width: 100%;
42
+ }
43
+
44
+ td.column-se-actions ul.se-actions-list li,
45
+ td.inc-excl ul.se-actions-list li {
46
+ margin: 0;
47
+ padding: 0;
48
+ list-style: none;
49
+ width: 100%;
50
+ }
51
+
52
  .ui-accordion-header {
53
  border-top-left-radius: 3px;
54
  border-top-right-radius: 3px;