Title: Count reviews programmatically
Last modified: November 21, 2017

---

# Count reviews programmatically

 *  Resolved [vertigofactory](https://wordpress.org/support/users/vertigofactory/)
 * (@vertigofactory)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/count-reviews-programmatically/)
 * Hi, I would like to get the total count of reviews assigned to a particular post
   using the helper function `glsr_get_reviews( $args );`. I tried passing the post
   ID in the ‘post__in’ property, but it doesn’t work. Is it possible? Thank you

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

 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/count-reviews-programmatically/#post-9707671)
 * I need to update the documentation.
 * Try this:
 *     ```
       $reviews = glsr_get_reviews([
           'assigned_to' => $post->ID,
           'count' => -1,
       ]);
       glsr_debug( count( $reviews ));
       ```
   
 *  Thread Starter [vertigofactory](https://wordpress.org/support/users/vertigofactory/)
 * (@vertigofactory)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/count-reviews-programmatically/#post-9709272)
 * perfect, it works! 🙂
    thank you!
    -  This reply was modified 8 years, 6 months ago by [vertigofactory](https://wordpress.org/support/users/vertigofactory/).
 *  Plugin Author [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * (@geminilabs)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/count-reviews-programmatically/#post-9709453)
 * Great! Don’t forget to use a [function_exists](http://php.net/manual/en/function.function-exists.php)
   check when using the helper functions as otherwise your website will break if
   ever the Site Reviews plugin is disabled or removed.

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

The topic ‘Count reviews programmatically’ is closed to new replies.

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

 * 3 replies
 * 2 participants
 * Last reply from: [Gemini Labs](https://wordpress.org/support/users/geminilabs/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/count-reviews-programmatically/#post-9709453)
 * Status: resolved