Uploading PDF files from the front-end
I have done a simple function for that, but i allow all types of media. So this could be a start: function insert_attachment( $file_handler, $post_id, $settpdf=”false” ) { // check to make sure its a successful upload if ( $_FILES[$file_handler][‘error’] !== UPLOAD_ERR_OK ) __return_false(); require_once( ABSPATH . ‘wp-admin’ . ‘/includes/image.php’ ); require_once( ABSPATH . ‘wp-admin’ … Read more