Title: pigen_attachment_pre_get_posts
Last modified: September 1, 2016

---

# pigen_attachment_pre_get_posts

 *  Resolved [Hrohh](https://wordpress.org/support/users/hrohh/)
 * (@hrohh)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/pigen_attachment_pre_get_posts/)
 * In function pigen_attachment_pre_get_posts there should be something similar,
   not new call get_posts, I have some trouble with plugin “WP Real Media Library”
 *  $mq = $query->get(‘meta_query’);
    if (!is_array($mq)) { $mq = array(); }
 *  if ($folder > 0) {
    $mq[] = array( ‘key’ => ‘_thumbnail_id’, ‘value’ => ”, ‘
   compare’ => ‘=’ );
 *  $query->set(‘meta_query’, $mq);
    }
 * If you want exclude thumbs, you can use better filter for this..
 *  add_filter( ‘posts_where’ , ‘remove_images’ );
    function remove_images($where){
   global $wpdb; $where.=’ AND ‘.$wpdb->posts.’.post_mime_type NOT LIKE \’pdf/%\”;
   return $where; }
 * [https://wordpress.org/plugins/pdf-image-generator/](https://wordpress.org/plugins/pdf-image-generator/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Mizuho Ogino](https://wordpress.org/support/users/fishpie/)
 * (@fishpie)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/pigen_attachment_pre_get_posts/#post-7485764)
 * As you mentioned, I remove get_posts from pre_get_posts filter in ver 1.4.6.
   
   I don’t have WP Real Media Library. So please check it.
 * I mark this as resolved, but please update if you have any suggestions.
    Thank
   you for great feedback!!

Viewing 1 replies (of 1 total)

The topic ‘pigen_attachment_pre_get_posts’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pdf-image-generator_c3bea9.svg)
 * [PDF Image Generator](https://wordpress.org/plugins/pdf-image-generator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pdf-image-generator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pdf-image-generator/)
 * [Active Topics](https://wordpress.org/support/plugin/pdf-image-generator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pdf-image-generator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pdf-image-generator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Mizuho Ogino](https://wordpress.org/support/users/fishpie/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/pigen_attachment_pre_get_posts/#post-7485764)
 * Status: resolved