Created
March 15, 2015 16:06
-
-
Save besimhu/3636fc8d844c053ac633 to your computer and use it in GitHub Desktop.
When you view a tag, it only lists custom post type with ‘post’ … this function changes that.
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
// Allow custom post types in tag search | |
function post_type_tags_fix($request) { | |
if ( isset($request['tag']) && !isset($request['post_type']) ) | |
$request['post_type'] = 'any'; | |
return $request; | |
} | |
add_filter('request', 'post_type_tags_fix'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment