bp_attachments_get_user_has_cover_image( int $user_id )
Does the user has a cover photo?
Description
Parameters
- $user_id
-
(Required) User ID to retrieve cover photo for.
Return
(bool) True if the user has a cover photo, false otherwise.
Source
File: bp-core/bp-core-attachments.php
function bp_attachments_get_user_has_cover_image( $user_id = 0 ) {
if ( empty( $user_id ) ) {
$user_id = bp_displayed_user_id();
}
$cover_src = bp_attachments_get_attachment( 'url', array(
'item_id' => $user_id,
) );
return (bool) apply_filters( 'bp_attachments_get_user_has_cover_image', $cover_src, $user_id );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.4.0 | 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.