Viewing 1 replies (of 1 total)
  • Plugin Author Brajesh Singh

    (@sbrajesh)

    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.