Home › Forums › Add-ons › Options Page › Using library 'uploadedTo' on an options page › Reply To: Using library 'uploadedTo' on an options page
Uploaded to post is something that’s built into WP. The post ID is set as the parent of the attachment. There isn’t any way to do this for options pages or for that matter, terms in a taxonomy or any other object in WP.
I do not recall any topics ever being submitted here that included a solution for this.
I’m not even sure that it would be possible at all and I’m not sure where you’d start looking. The upload uses the built in WP file upload and works through AJAX. You might be able to add some filters during the process to detect that an attachment is being uploaded for a specific options page, then you could probably add a post meta field to the attachment to indicate what it was uploaded to, and finally you could probably filter the images that are being displayed during the AJAX call that shows these images to only show others that were uploaded for the same options page. However, this is all guess work, you’re probably looking at several hours of research and testing to get each part of this working, that is if it will work, and there’s no way of knowing until you try it.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.