We need a way to display the uploaded files within the post edit screen as well as on the frontend, after the post content. For this, we are going to use a common function called wpqpa_file_attachment_list to generate an attachments list, as shown in the following code:
function wpqpa_file_attachment_list( $post ){ global $wpdb; $display = '<div class="wpqpa-files-list" >'; $sql = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}wpqpa_post_attachments WHERE post_id = %d order by updated_at desc ", $post->ID ); $files_list = $wpdb->get_results( $sql ); foreach( $files_list as $file_row ){ $url = get_permalink( $file_row->post_id ); $url = wpqpa_add_query_string( $url, "wpqpa_file_download=yes&wpqpa_private_file_id ...