Created
April 5, 2020 05:44
-
-
Save codename065/5a5b65735f873a44934dbc3012736b78 to your computer and use it in GitHub Desktop.
Remove Download Manager Packages from search
This file contains 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 | |
function wpdm_remove_search($query) { | |
if ($query->is_search) { | |
$post_type = array('post', 'page'); | |
$query->set('post_type', $post_type); | |
}; | |
return $query; | |
}; | |
add_filter('pre_get_posts', 'wpdm_remove_search'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment