get_categories function not working as expected
-
Hello,
I have a problem with the function get_categories.When I set the argument “taxomy” to array(‘custom_tax’, ‘category’) the function only returns terms from the default category and not from the custom_tax. When I set the argument to array(‘post_tag’, ‘category’) it returns terms from post_tag and category. When I only use my custom_tax it returns all terms from my custom taxonomy.
Why does it not work with custom taxonomies and the default category? I tried get_terms as well, with the same outcome.
Here is my code:
$args = array( 'hide_empty' => 0, 'hierarchical' => 1, 'taxonomy' => array('category', 'custom_tax'), ); $postCats = get_categories( $args );
Thanks in advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_categories function not working as expected’ is closed to new replies.