Home › Forums › Backend Issues (wp-admin) › Populate Select field with files in media library › Reply To: Populate Select field with files in media library
The easiest way would be to create a file field and set the allowed file types to .pdf. This will only allow the editor to select pdf files from the media library.
If you want to do this the hard way you could https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/. You’ll need to do a query of the attachments to get all the pdf files to use to do the population. I’m not sure how you’d do this but this looks like it might do the trick https://wordpress.stackexchange.com/questions/22069/is-it-possible-to-query-specific-wordpress-attachment-files-ppt-pdf-and-ou
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.