Home › Forums › General Issues › Extending acf_field_image › Reply To: Extending acf_field_image
There are several problems with doing this.
The first is that I don’t think you can extend an existing ACF field in this way, but I’ve never tried so I can’t really say and I don’t know of any examples where this has been done.
The second is that even if you do extend the field there is nowhere in the database for ACF to store these values. An ACF image field stores only the image ID value of the image. Adding inputs to a field that are filled in when editing a page will not cause these values to actually be stored anywhere unless you add code that will take those values and store them in some way.
The only way that you’ll be able to do this is to build a new field type from scratch https://www.advancedcustomfields.com/resources/creating-a-new-field-type/. You can start by copying the existing image field and you’ll need to add your new information and then store the image ID plus your new values as an array of values instead of just storing the image ID. In acf each field has only one value stored in the database.
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.