Changeset 1227303
- Timestamp:
- 08/21/2015 02:52:09 PM (11 years ago)
- Location:
- osd-exclude-from-search-results
- Files:
-
- 7 added
- 3 edited
-
tags/2.4 (added)
-
tags/2.4/includes (added)
-
tags/2.4/includes/OSDExcludeFromSearchResults.php (added)
-
tags/2.4/includes/global_settings.php (added)
-
tags/2.4/includes/installation_actions.php (added)
-
tags/2.4/osd_exclude_from_search_results.php (added)
-
tags/2.4/readme.txt (added)
-
trunk/includes/OSDExcludeFromSearchResults.php (modified) (2 diffs)
-
trunk/osd_exclude_from_search_results.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
osd-exclude-from-search-results/trunk/includes/OSDExcludeFromSearchResults.php
r1149297 r1227303 107 107 function osd_exclude_from_search_filter($query) { 108 108 if($query->is_search) { 109 $acceptable_post_types = array(); 110 $all_post_types_array = get_post_types(array('public' => 1), 'array'); 111 foreach($all_post_types_array as $post_type) { 112 if (!isset($this->user_settings['exclude_all'][$post_type->name])) { 113 $acceptable_post_types[] = $post_type->name; 109 // Entire post types 110 if (!isset($query->query_vars['post_type'])) { 111 $acceptable_post_types = array(); 112 $all_post_types_array = get_post_types(array('public' => 1), 'array'); 113 foreach($all_post_types_array as $post_type) { 114 if (!isset($this->user_settings['exclude_all'][$post_type->name])) { 115 $acceptable_post_types[] = $post_type->name; 116 } 114 117 } 115 } 116 118 119 $query->set('post_type', $acceptable_post_types); 120 } 121 122 // Individual posts 117 123 global $wpdb; 118 124 $prefix = $wpdb->base_prefix; … … 131 137 132 138 $query->set('post__not_in', $excludeArray); 133 $query->set('post_type', $acceptable_post_types);134 139 } 135 140 return $query; -
osd-exclude-from-search-results/trunk/osd_exclude_from_search_results.php
r1149301 r1227303 4 4 Plugin URI: http://outsidesource.com 5 5 Description: A plugin that excludes selected pages or posts from the search results. 6 Version: 2. 36 Version: 2.4 7 7 Author: OSD Web Development Team 8 8 Author URI: http://outsidesource.com -
osd-exclude-from-search-results/trunk/readme.txt
r1149301 r1227303 3 3 Tags: wordpress, search results, exclude from search, posts, pages, hide from search 4 4 Requires at least: 3.4 5 Tested up to: 4. 26 Stable tag: 2. 35 Tested up to: 4.3 6 Stable tag: 2.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 68 68 == Upgrade Notice == 69 69 70 = 2.4 = 71 Now Compatible with other custom searches on post types 72 70 73 = 2.3 = 71 74 Now works correctly with Media / Attachments post type
Note: See TracChangeset
for help on using the changeset viewer.