May 2017
Beginner to intermediate
536 pages
14h 25m
English
Now, we can begin the conversion of file fields into the media uploader-integrated button and file container. While creating the file field for topics, we assigned a special CSS class called wpwaf_files. This class is used to identify the file fields that need to be converted. Let's get started with the implementation inside the wpwa-file-uploader.js file:
jQuery(document).ready(function($){ $(".wpwaf_files").each(function(){ var fieldId = $(this).attr("id"); $(this).after("<div id='wpwaf_upload_panel_"+ fieldId +"' > </div>"); $("#wpwaf_upload_panel_"+ fieldId).html("<input type='button' value='"+WPWAFUpload.addFileText+"' class='wpwaf_upload_btn' id='"+ fieldId +"' />"); $("#wpwaf_upload_panel_"+ ...Read now
Unlock full access