Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sw_custom_post_type_includes($query) {
- if(isset($_GET['post_type']) && is_search() && is_main_query() && $query->query_vars['post_type'] != 'nav_menu_item'){
- $query->set('post_type', urldecode($_GET['post_type']));
- }
- }
- add_filter('pre_get_posts', 'sw_custom_post_type_includes');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement