Yeah, I didn’t include all the functions I’ve written as I didn’t want to swamp the thread but I’ve already overridden functions like
update_value() to treat the data as an array and not just an ID. Everything is working in theory, it’s just the interaction with the media library.
Once I’ve got the script working, I might publish it here somewhere as an example of extending a field… interestingly, all fields extend the base
acf_field class and
acf_field_image actually seems to inherit (or more accurately reuse) methods from
acf_field_file. I like the idea of extending classes as it means I can generally ignore a lot of validation/output/save steps.
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!
© 2023 Advanced Custom Fields.