Include custom post type custom taxonomies in Categories widget

Question

I wanted to see if this was possible, but I want to include the custom post type custom taxonomy categories inside the WordPress Categories widget.

I know that there is a filter as shown below:

add_filter('widget_categories_args', function() {
    $params['post_type'] = array('post', 'recipe');
    return $params;
});
  1. My taxonomy is called recipe-categories inside wp_term_taxonomy and I want to be able to pull in all the categories inside the Categories Widget.

  2. recipe is my custom post type.

  3. Url string is taxonomy=recipe-categories&post_type=recipe

Here are all the categories that I have:

enter image description here

All that I’m getting back is the post categories and not my recipe categories as shown below:

enter image description here

0
, , , Sem 4 years 2020-02-16T08:39:01-05:00 0 Answers 62 views 0

Leave an answer

Browse
Browse