WordPress and buddypress programming

Get Poke Count for a User

Viewing 0 reply threads
  • Author
    Posts
    • #2150
      michael mc
      Keymaster
      @michael

      Get Poke Count for a User

      function bp_poke_get_poke_count( $user_id ){
          $pokes =  bp_get_user_meta( $user_id, 'pokes', true );
          if( ! empty( $pokes ) )
              return count( $pokes );
          return 0;
      }
      You can pass bp_displayed_user_id() while calling this function to show the poke count of diplayed user. To show the poke count of logged in user, pass get_current_user_id()
Viewing 0 reply threads
  • You must be logged in to reply to this topic.