Home › Forums › ACF PRO › ACF field type : file on server › Reply To: ACF field type : file on server
A field type might be nice, but this is completely doable with the existing ACF fields and a filter or 2.
I would use a select field and https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/ using scandir http://php.net/manual/en/function.scandir.php to get the files to populate the field.
Then I would create a format value filter https://www.advancedcustomfields.com/resources/acf-format_value/ to convert the file name into a URL. But you could also set the value to the url when populating the choices.
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.