Created
January 11, 2016 04:51
-
-
Save dboutote/fc2cfafa67cfcc47661b to your computer and use it in GitHub Desktop.
Instruct WordPress to search on all post types when doing a category taxonomy query.
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 post_type_category_fix($request) { | |
if ( isset($request['category_name']) && !isset($request['post_type']) ) | |
$request['post_type'] = 'any'; | |
return $request; | |
}; | |
add_filter('request', 'post_type_category_fix'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment