Home › Forums › Backend Issues (wp-admin) › Image Alt Tag › Reply To: Image Alt Tag
Sorry for leaving you hanging, my notification on the topic got turned off for some reason.
I’ve looked over your code and I’m a little lost, maybe.
If you want to use the “Alt” value stored WP when uploading an image then you should be returning an image object from the ACF field. This would entirely change the code you using because it appears that you are returning the URL of the image.
If you return an image object, then the alt value will be part of that object.
If you return an image ID then you can get the rest of the image data using standard WP functions with that ID.
If you return the URL, the way you are doing, you will be unable to get any other information about the image and, like you said, you’ll need to supply another field for the user to input the alt value.
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.