get_post_type_object for "post" post_type has no taxonomies
-
I’m not sure what’s going on here, so I’m looking for advice.
When I implement this code:
$post_type_obj = get_post_type_object('post'); $taxonomy_names = get_object_taxonomies( 'post' ); var_dump($taxonomy_names); echo "<br><br>"; var_dump($taxonomy_names); exit();
I get the following:
array(0) { } array(3) { [0]=> string(8) "category" [1]=> string(8) "post_tag" [2]=> string(11) "post_format" }
This only happens with the post post_type. If I use a custom post type, both dump out identical arrays. Why are the taxonomies missing from get_post_type_object() but not get_object_taxonomies()? Both pull from a global variable, not the database, I believe.
Any ideas/help would be appreciated.
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘get_post_type_object for "post" post_type has no taxonomies’ is closed to new replies.