dimanche 20 mars 2016

Assign an attachment to a taxonomy when uploading media

I'm creating a plugin that adds a downloads section to the WP admin. I'm using a taxonomy for categories and then want to be able to upload media into these categories.

I've got everything working in terms of displaying the taxonomies and the attachments that will be assigned to them.

The problem I'm having is assigning the attachment to the taxonomy once it's uploaded. I'm trying to use the add_attachment hook but I can't seem to pass the taxonomy ID to it. I've tried using get_query_var (I have the taxonomy ID as a GET parameter) and get_current_screen but that just returns the async-upload screen value.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire