Title: Filtering &#039;buddydrive_has_items&#039;
Last modified: August 30, 2016

---

# Filtering 'buddydrive_has_items'

 *  Resolved [Mat](https://wordpress.org/support/users/mat2010/)
 * (@mat2010)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/)
 * Hello Math,
 * Using Buddydrive 1.3.0 and the last version of BP and WP, I try to list all the
   PUBLIC documents uploaded by the community in one place in my website.
 * For this, I have created a page template in which I use the ‘buddydrive_has_items’
   query.
 * [https://gist.github.com/Mat2012/be7756ac236da562bc9c#file-buddydrive-in-a-page-L32](https://gist.github.com/Mat2012/be7756ac236da562bc9c#file-buddydrive-in-a-page-L32)
 * But this doesnt work : all the docs are displayed, even if they are set to “private”.
   I don’t know how to filter the query in order to show only the documents which
   are public (and I don’t want the files to appear, only the docs).
 * What would you recommend ?
 * Thanks a lot !
 * M
 * [https://wordpress.org/plugins/buddydrive/](https://wordpress.org/plugins/buddydrive/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Mathieu Viet](https://wordpress.org/support/users/imath/)
 * (@imath)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/#post-6303347)
 * Hello Mat 🙂
 * I remember i promised to check it. Will do asap, probably this week-end. I’ll
   come back on this post asap.
 *  Thread Starter [Mat](https://wordpress.org/support/users/mat2010/)
 * (@mat2010)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/#post-6303348)
 * Thank you ! 🙂
 *  [Mathieu Viet](https://wordpress.org/support/users/imath/)
 * (@imath)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/#post-6303350)
 * Ok,
 * Using 1.3.0, to list files that can be seen by any user, the custom loop needs
   to look like this :
 *     ```
       <?php if ( buddydrive_has_items( array( 'buddydrive_scope' => 'files', 'type' => buddydrive_get_file_post_type() ) ) ): ?>
       <?php while ( buddydrive_has_items() ) : buddydrive_the_item(); ?>
       <?php // custom code to display files ;?>
       <?php endwhile; ?>
       <?php endif; ?>
       ```
   
 * the “files” buddydrive_scope will get all public and password protected files.
 * In 1.3.1, it will be possible to get only public files using a custom loop starting
   this way
    `<?php if ( buddydrive_has_items( array( 'buddydrive_scope' => 'public','
   type' => buddydrive_get_file_post_type() ) ) ): ?>`
 * see [https://github.com/imath/buddydrive/issues/36](https://github.com/imath/buddydrive/issues/36)
 * Thanks for your suggestion.
 *  Thread Starter [Mat](https://wordpress.org/support/users/mat2010/)
 * (@mat2010)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/#post-6303351)
 * Thank you [@imath](https://wordpress.org/support/users/imath/) ! I can’t wait
   to try the next update 🙂
 *  [bbhood](https://wordpress.org/support/users/bbhood/)
 * (@bbhood)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/#post-6303444)
 * Hello and thank U, 2.0 pdate is great,
 * reopening this topic because since this latest update, this loop doesn’t seem
   to work anymore ?
 * Any help would be apprciated !

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Filtering 'buddydrive_has_items'’ is closed to new replies.

 * ![](https://ps.w.org/buddydrive/assets/icon-256x256.png?rev=3305954)
 * [BuddyDrive](https://wordpress.org/plugins/buddydrive/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddydrive/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddydrive/)
 * [Active Topics](https://wordpress.org/support/plugin/buddydrive/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddydrive/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddydrive/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [bbhood](https://wordpress.org/support/users/bbhood/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/filtering-buddydrive_has_items/#post-6303444)
 * Status: resolved