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.

有帮助吗?

解决方案

wp_get_attachment_image_src( $id , false );

try this or try this

$new_src=wp_get_attachment_image_src( $src , false );

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top