Title: Get vote with php function
Last modified: August 31, 2016

---

# Get vote with php function

 *  [benoitmorel](https://wordpress.org/support/users/benoitmorel/)
 * (@benoitmorel)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-vote-with-php-function/)
 * Hi,
 * I’m trying to use the YASR vote as an argument to sort a table. To do so, I’d
   need a function to retrieve the ranking of an entity, based on its id. Is there
   such a function implemented ?
 * Thanks a lot,
 * Benoit
 * [https://wordpress.org/plugins/yet-another-stars-rating/](https://wordpress.org/plugins/yet-another-stars-rating/)

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

 *  Plugin Contributor [dudo](https://wordpress.org/support/users/dudo/)
 * (@dudo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-vote-with-php-function/#post-7089190)
 * Hello Benoit, what vote do you need? The one generate from the shortcode yasr_overall_rating
   or yasr_visitor_votes?
 * Best,
    Dario
 *  Thread Starter [benoitmorel](https://wordpress.org/support/users/benoitmorel/)
 * (@benoitmorel)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-vote-with-php-function/#post-7089192)
 * Hi,
 * the yasr_visitor_votes one
 * Best,
 * Benoit
 *  Thread Starter [benoitmorel](https://wordpress.org/support/users/benoitmorel/)
 * (@benoitmorel)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-vote-with-php-function/#post-7089203)
 * I’d just like to get the average value.
 *  Plugin Contributor [dudo](https://wordpress.org/support/users/dudo/)
 * (@dudo)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/get-vote-with-php-function/#post-7089351)
 * ok, you can use yasr_get_visitor_votes ($post_id)
 * If you want to see the code of the function, it is declared in yasr-db-functions.
   php
 * Best,
    Dario

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

The topic ‘Get vote with php function’ is closed to new replies.

 * ![](https://ps.w.org/yet-another-stars-rating/assets/icon-256x256.png?rev=1525329)
 * [YASR - Yet Another Star Rating Plugin for WordPress](https://wordpress.org/plugins/yet-another-stars-rating/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yet-another-stars-rating/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yet-another-stars-rating/)
 * [Active Topics](https://wordpress.org/support/plugin/yet-another-stars-rating/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yet-another-stars-rating/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yet-another-stars-rating/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [dudo](https://wordpress.org/support/users/dudo/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/get-vote-with-php-function/#post-7089351)
 * Status: not resolved