Support

Account

Home Forums General Issues Querying a subfield to retrieve an image Reply To: Querying a subfield to retrieve an image

  • I really appreciate you taking the time to help.

    Posted this on Stackoverflow and got an answer (even though somebody else deleted the right answer before I could thank them).

    For anybody else who comes across this, I need to convert it this way.

    $image_id = get_post_meta( $row->post_id, $meta_key, true );
    
    					//$image_ids = unserialize($image_id);
    					$json = json_decode($image_id);
    
    					// load image src
    					// - https://www.advancedcustomfields.com/resources/field-types/image/
    					$src = wp_get_attachment_image_src( $json->cropped_image, 'cropped_image' );

    It was a JSON object which needed to be decoded.

    Thanks again for helping – means a lot to somebody who was completely stuck.