I have the same question. A specific example is that we use bbPress for support and there’s an image uploader. We’d love for all those uploads to be automatically added to a category. It would help organization a lot.
It would be BONUS to be able to hide media from a certain category by default.
Thanks for an excellent plugin! Looking forward to your feedback on these ideas.
Hello guys,
Just like any other WordPress post type to any WordPress taxonomy: by wp_set_object_terms (https://codex.ww.wp.xz.cn/Function_Reference/wp_set_object_terms)
For example:
$attachment_id = 5; // your attachment ID
$terms = array( 21,76 ); // IDs of the taxonomy terms to which you'd like to assign an attachment
$taxonomy = "media_category"; // taxonomy name
wp_set_object_terms( $attachment_id, $terms, $taxonomy );
As for “It would be BONUS to be able to hide media from a certain category by default.” — can you please describe this in more details? A bit unclear to me. Thanks!
-Nadia