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.