I'm trying to get all the post types that has tags functionality. I searched a lot but couldn't find a conditional or something for that. I need a way to get post types or post objects for the posts which are taggable.
Here are my current code to get post types:
public function getPostTypes() {
$excludes = array('attachment');
$postTypes = get_post_types(
array(
'public' => true,
),
'names'
);
foreach ($excludes as $exclude) {
unset($postTypes[$exclude]);
}
return array_values($postTypes);
}
Thanks!