Custom Fields
Re-Envisioned
Support General Images not showing after updating to 4.8.1 and related extensions

  • Creator
    Topic
  • #2357
    bucketpress
    Participant

    After updating:
    MetaBox to 4.8.1
    Group to 1.05
    Conditional Logic to 1.2

    Images on the frontend are not showing after the updates.
    My image is an image_advanced field named 'iconimage' and is part of a group field named 'qwerty_icons'

    I'm retrieving the group fields and displaying the image as such:

    $icons = get_post_meta($post->ID, 'qwerty_icons', true);
    foreach ( $icons as $icon ) {
    $imgsrc = wp_get_attachment_url( $icon[iconimage]) );
    }

    Before the update, calling $icon[iconimage] returns the attachment id. But after the update I realised it returned an array instead, and I had to call $icon[iconimage][0] to return the id.

    Is this how the image_advanced field is saved now (as an array)? Or is this a bug?

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #2360
    Anh Tran
    Keymaster

    Hi,

    Yes, the image fields should be always saved as an array. In the previous version of Meta Box, the value of file and image are sent as a CSV string and then parsed to an array. IF you upload only 1 image, then CSV = attachment ID, I think that's why you see the only 1 ID when you get $icon[iconimage]. Now it's always an array to make compatible with the core plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘Images not showing after updating to 4.8.1 and related extensions’ is closed to new replies.