Hi ! I have added a custom field in the rtmedia uploader (called “city”), and I would like this field to be displayed in the lightbox, after the image upload, so that we can see in the lighbox the city writen by the user.
Here is the code added in functions.php:
function custom_data() {
global $rtmedia_media;
?> <div> city :<input class="city" id="city" type="text" name="city" value="" /> </div>
<?php
}
add_action('rtmedia_uploader_before_start_upload_button', 'custom_data');
And I have also added this code in my js file but it still doesn’t work:
(function($) {
"use strict";
$(document).ready(function() {
// Add custom field after file upload
rtMediaHook.register(
'rtmedia_js_after_file_upload',
function (args ) {
var donnees = $(this).serialize();
$.ajax({
type: "POST",
url: "../../../plugins/buddypress-media/templates/media/media-single.php",
data: donnees,
success : function(data){
$("#texte_a_inserer").html(data);
}
});
});
});
})(jQuery);
Thanks a lot for your help! Marine