Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pm_kb_categories_query($query, $old_query, $uri_parts, $pm_query, $content_type) {
- if(isset($query['knowledgebase_cat']) && !empty($pm_query['id']) && strpos($pm_query['id'], 'tax-') !== false) {
- $query['post_type'] = 'knowledgebase';
- unset($query['taxonomy']);
- unset($query['term']);
- $term_id = intval(preg_replace("/[^0-9]/", "", $pm_query['id']));
- $term = get_term($term_id);
- if(empty($term->parent)) {
- $query['is_knowledgebase_product'] = 1;
- }
- }
- return $query;
- }
- add_filter('permalink_manager_filter_query', 'pm_kb_categories_query', 5, 5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement