Home Forums Backend Issues (wp-admin) Image field returns incorrect value type


Image field returns incorrect value type

  • When I’m using an Image field inside of a Repeater that’s inside a Flexible Content layout, the return values are coming back incorrectly. I haven’t thoroughly tested to see if it’s working correctly in other scenarios.

    When I select Array, it returns the ID. When I select URL, it returns the Array. And when I select ID, it returns the URL. For now I’m just relying on the choosing the radio button that gives me the value I need, but it’s not the one I’ve selected.

    ACF v5.6.8
    WP v4.9.4

  • I just did a quick test flex field => repeater => image and the image field returns the correct value set up for the field.

    I would look at other plugins or something in the theme that is interfering with ACF returning the correct value.

  • I’m also on a Multisite, could that be causing the issue?

  • As far as I know, only if you’re using something like switch_to_blog and the blog you’re switching somehow has a different return format set for the field. Even here, I’m not sure. If for example the first time ACF loads the field with that field name/key. Whatever return value is loaded then is what will be used since it will be cached so that ACF does not query the DB again. Outside of this there would need to be some filter that’s altering the return value setting for the field.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Image field returns incorrect value type’ is closed to new replies.