Title: Total Pokes Received
Last modified: August 31, 2016

---

# Total Pokes Received

 *  [rodhewitt](https://wordpress.org/support/users/rodhewitt/)
 * (@rodhewitt)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/total-pokes-received/)
 * How can i get the total Pokes received for the current user?
 * There is a similar code such as BuddyPress messages?
 * Like: <?php bp_total_unread_messages_count() ?>
 * [https://wordpress.org/plugins/bp-poke/](https://wordpress.org/plugins/bp-poke/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * (@sbrajesh)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/total-pokes-received/#post-7349652)
 * Hi,
    At the moment, There is no function available in the plugin. I wrote a custom
   one for you.
 *     ```
       function bp_poke_custom_get_pokes_count( $user_id  ) {
       	$pokes = bp_get_user_meta( $user_id, 'pokes', true );
       	if ( empty( $pokes ) ) {
       		return 0;
       	}
   
                $pokes = array_filter( $pokes );
       	return count( $pokes );
       }
       ```
   
 * Please put that in your functions.php or bp-custom.php and then you can use the
   following code to show it for the logged in/displayed user
 *     ```
       //for logged in user
       bp_poke_custom_get_pokes_count( bp_loggedin_user_id() );
       //for displayed user
       bp_poke_custom_get_pokes_count( bp_displayed_user_id() );
       ```
   
 * Hope that helps.
    Regards Brajesh

Viewing 1 replies (of 1 total)

The topic ‘Total Pokes Received’ is closed to new replies.

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

 * 1 reply
 * 2 participants
 * Last reply from: [Brajesh Singh](https://wordpress.org/support/users/sbrajesh/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/total-pokes-received/#post-7349652)
 * Status: not resolved