Wordpress - Upload multiple files using wp_handle_upload
We are going to use Ajax and PHP to perform multiple file uploads in a wordpress plugin. jQuery Ajax code. To send files. $ ( "#button_id" ) . click ( function ( e ) { e . preventDefault ( ) ; var filedata = document . getElementById ( "inputGroupFiles" ) , formdata = false ; if ( window . FormData ) { formdata = new FormData ( ) ; } var len = filedata . files . length , img , reader , file ; for ( var i = 0 ; i < len ; i + + ) { file = filedata . files [ i ] ; if ( formdata ) { formdata . append ( "file[]" , file ) ; } } formdata . append ( 'action' , 'my_action_upload_logos' ) ; jQuery . ajax ( { url : '<?php echo admin_url(' admin - ajax . php '); ?>' , type : 'post' , contentType : false , processData : false , data : formdata ...