bbp_user_has_profile( int $user_id )
Does a user have a profile for the current site
Description
Parameters
- $user_id
-
(Required) User ID to check
- $blog_id
-
(Required) Blog ID to check
Return
(boolean) Whether or not the user has a profile on this blog_id
Source
File: bp-forums/users/capabilities.php
function bbp_user_has_profile( $user_id = 0 ) { // Assume every user has a profile $retval = true; // Validate user ID, default to displayed or current user $user_id = bbp_get_user_id( $user_id, true, true ); // Try to get this user's data $user = get_userdata( $user_id ); // No user found, return false if ( empty( $user ) ) { $retval = false; // User is inactive, and current user is not a keymaster } elseif ( ! bbp_is_user_keymaster() && bbp_is_user_inactive( $user->ID ) ) { $retval = false; } // Filter and return return (bool) apply_filters( 'bbp_show_user_profile', $retval, $user_id ); }
Changelog
Version | Description |
---|---|
bbPress (r4362) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.