Ticket #9559: bug9559.omit-passworded-posts-from-search.diff
| File bug9559.omit-passworded-posts-from-search.diff, 648 bytes (added by coffee2code, 3 years ago) |
|---|
-
wp-includes/query.php
1759 1759 if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] ) 1760 1760 $search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')"; 1761 1761 1762 if ( !empty($search) ) 1762 if ( !empty($search) ) { 1763 1763 $search = " AND ({$search}) "; 1764 if ( !$this->is_admin ) 1765 $search .= " AND ($wpdb->posts.post_password = '') "; 1766 } 1764 1767 } 1765 1768 1766 1769 // Category stuff
