Hi !
I have followed this topic to add a custom data field in uploader and to save and display result in the lightbox.
I have added the codes below but I can't retrieve my custom data.
Perhaps that I need to add another function in php to be able to retrieve my custom data, or that I should modify the js file?
Thank you very much for your help !
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 in my js file:
(function($) {
"use strict";
$(document).ready(function() {
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);