Question

I have meta-box plugin and I added file upload

array(
    'name' => __( 'Image or Video Upload', 'rwmb' ),
     'id'   => "{$prefix}upload",
     'type' => 'file_advanced',
     'max_file_uploads' => 1,
     'mime_type' => 'image,video', 
),

and I code for fetch value

$postid = get_the_ID();
$meta = get_post_custom($postid);
$src = $meta['myprefix_upload'][0];

but it will return id of image,

and my need is fetch url.

How can I solve it?

thanks in advance.

Was it helpful?

Solution

wp_get_attachment_image_src( $id , false );

try this or try this

$new_src=wp_get_attachment_image_src( $src , false );

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top