hi !
I’ve added custom field to my medias. Added it to view in the “facebook style” popup. All is working very well.
But now i’m facing a problem : I dont know how to added this field to the upload part.
Here are the code i’ve used in my function.php :
// PRIX
function custom_rtmedia_prix_build($type) {
if ( $type == 'photo' ) {
global $rtmedia_media;
$id = $rtmedia_media->id;
$prix = get_rtmedia_meta($id,'prix');
echo '<br /><label for="prix">Prix</label> ';
echo '<input class="prix" id="prix" type="text" name="prix" value="'.$prix.'" />';
}
}
add_action('rtmedia_add_edit_fields', 'custom_rtmedia_prix_build');
function custom_save_rtmedia_prix_build($id, $state) {
$type = rtmedia_type($id);
if ( $type == 'photo' ) {
$prix = get_rtmedia_meta($id,'prix');
if ( $prix != $_POST['prix'])
update_rtmedia_meta($id,'prix',$_POST['prix']);
}
}
add_action('rtmedia_after_update_media', 'custom_save_rtmedia_prix_build', 10,2);
And in media-single.php :
global $rtmedia_media;
$id = $rtmedia_media->id;
$marque = get_rtmedia_meta($id,'marque');
I guess i need to modify uploader.php. But i dont know where to start and if there is any hook to do this.
Does anyone know how to achieve this ?
Ty !