Custom image uploader for cpt and force taxonomy attachment
-
I have a need to upload images to specific client pages (cpt), so for example a client would own all of their images that I do not want associated with another client.
I would like to upload the images from the client’s post, and have those images automatically attached to a custom taxonomy. What would be the best approach to doing this?
Currently I’m using ACF for the gallery field on the client page to upload the images. It works, but not ideal. If I upload a group of photos it will not allow me to attach the custom tax to all of the images, so they still have to be clicked and edited in the gallery field of the admin screen of that client’s page.
Background:
I plan to ultimately have a function that runs when a new client post is made that also creates the custom taxonomy in that same client’s name. So ‘John Smith’ has his client page titled ‘John Smith’ and the custom tax used to attach images to this client would also be ‘John Smith’. I’d like to take the guesswork out of attaching the correct tax to the images, so that a client page is created, as well as the custom tax, then images uploaded through that client page’s admin/edit screen will automatically be tagged with that client’s tax.
- The topic ‘Custom image uploader for cpt and force taxonomy attachment’ is closed to new replies.