• Resolved ohmel

    (@ohmel)


    Hello,

    I made a custom page showing all my documents uploaded to Document Gallery.
    I’ve invoked the <?php do_shortcode()?> for this plugin and it works perfectly.

    My problem is I need to filter or search these documents by name.

    //do search by here by post method and assign the result to variable $getdocumentIds array

    <?php if($getdocumentIds){?>
    <?php do_shortcode(‘[dg ids=”‘.implode(“,”, getdocumentIds).'”]’)?>
    <?php }?>

    Is there a way I can do that?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dan Rossiter

    (@danrossiter)

    Hi ohmel,

    It sounds like you may want to look at get_posts.

    -Dan

    Thread Starter ohmel

    (@ohmel)

    Oh yeah! I got it!
    but the get_posts function only made me query via post_type and mime_type, I’m trying to put into the post_title some data I want for my result set but it seems post_title isn’t working.

    But I found another way though, I don’t know if it’s right I used a custom mysql execution looking for a post title with post_type attachment and mime_type application/pdf and it worked I was able to manipulate the ids attribute of the shortcode.

    Thanks dan!

    Plugin Author Dan Rossiter

    (@danrossiter)

    Glad you got it working!

    -Dan

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Searching document by name’ is closed to new replies.