Hey–I’m just starting to dig into ACF Pro and I’m having trouble figuring something out. I’ve researched and haven’t found the answer–but I’m new so it may be obvious and I just don’t get it yet!
I want to create a field on the backend that will allow the author to select a .pdf file to attach to the post. I’d like them to be able to select the file from a pull down list that is automatically populated by all of the pdf files in the media library.
How hard is that?
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