Hi,
The file_input
field store the URL of the image in the post meta, so if you use rwmb_meta()
function, you will get the URL of the file.
In case you want to use more sizes of the file, WordPress has a helper function to retrieve attachment ID from the URL attachment_url_to_postid()
. The sample code looks like this:
$speakergroup = rwmb_meta( 'cf_speakers' );
foreach ( $speakergroup as $speakerdata ) {
$attachment_id = attachment_url_to_postid( $speakerdata['cf_speakerpic'] );
list( $src ) = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );
echo '<a href="' . $speakerdata['cf_speakerurl'] . '" target=_blank><img src="' . $src . '" class="circle wp-post-image"></a>';
}