Last active
August 29, 2015 14:02
-
-
Save williamdodson/277f830a57c6215a127c to your computer and use it in GitHub Desktop.
WP Search Exclude Change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ORIGINAL: search-exclude.php Line 119 */ | |
public function searchFilter($query) | |
{ | |
if ($query->is_search) { | |
$query->set('post__not_in', array_merge($query->get('post__not_in'), $this->getExcluded())); | |
} | |
return $query; | |
} | |
/* CHANGES: search-exclude.php Line 120 */ | |
/* modified this function to ignore admin dashboard --wdodson 2014-05-08 */ | |
public function searchFilter($query) | |
{ | |
if(!is_admin()) { | |
if ($query->is_search) { | |
$query->set('post__not_in', array_merge($query->get('post__not_in'), $this->getExcluded())); | |
} | |
return $query; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment