Frage

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.

War es hilfreich?

Lösung

wp_get_attachment_image_src( $id , false );

try this or try this

$new_src=wp_get_attachment_image_src( $src , false );

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top