Not sure if you’re still looking for a solution.
Here’s what I did:
- Goto Plugins->Editor, look for the Document Links Widget in the dropdown, press select and make sure you’re editing document-links-widget/rd-documentlinks-plugin.php
- Look for the following code on line 175:
$result= $wpdb->get_results("SELECT ID, post_title, guid, post_mime_type, post_date FROM ".$wpdb->posts." WHERE post_type = 'attachment' ORDER BY post_date ".$sortOrder, ARRAY_N);
- Replace with the following code:
global $post; $result= $wpdb->get_results("SELECT ID, post_title, guid, post_mime_type, post_date FROM ".$wpdb->posts." WHERE post_type = 'attachment' AND post_parent = ".$post->ID." ORDER BY post_date ".$sortOrder, ARRAY_N);
- Now, when you want to associate a document to a certain page/post, just attach it in Media->Library, after you have uploaded it