I’ve added a new taxonomy for the medias post type:
function register_taxonomy_for_images()
{
register_taxonomy_for_object_type('category', 'attachment');
}
add_action('init', 'register_taxonomy_for_images');
And I’ve added a few categories via wordpress admin.How can I get an array of all the media categories that I added? I’ve tried get_categories() but it doesn’t work.
Found the answer: