Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author lorieransom

    (@lorieransom)

    Hi there, sorry for the late reply. Currently the only way to limit the results is to manually select them in the Document Links Admin Panel. Of course this limited list will be what is displayed on every page where the widget is used. Hope that helps.

    Not sure if you’re still looking for a solution.

    Here’s what I did:

    1. 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
    2. Look for the following code on line 175:
    3. $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);

    4. Replace with the following code:
    5. 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);

    6. Now, when you want to associate a document to a certain page/post, just attach it in Media->Library, after you have uploaded it
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Document Links Widget] Current Page Only?’ is closed to new replies.