Meta Box
Support Forum
Support › General › Get an image url out of array
Hello!
Sorry for that kind of newbie question. But how get I the output of an array?
I've started with rwmb_meta('meta-box-id');
rwmb_meta('meta-box-id');
If I put in the ID of e.g. an advance_image meta box. How do I get the URL of an image?
Hi,
rwmb_meta( 'image_field_id' ) returns an array of image info. To get the URL of the image, simply use the code like this:
rwmb_meta( 'image_field_id' )
$image_info = rwmb_meta( 'image_field_id', 'size=thumbnail' ); echo $image_info['url']; // Thumbnail size URL echo $image_info['full_url']; // Full size URL
Hi there,
If you use above code, you will retrieve an array of image data, and you can get the image url from that array. Please read the docs here: https://metabox.io/docs/get-meta-value/#section-image
Thanks a lot! It was a great forrest, I didn't see the tree!