bp_attachments_get_user_has_cover_image

Does the user has a cover image?.

Description

bp_attachments_get_user_has_cover_image( (int) $user_id = 0 ); 

Parameters (1)

0. $user_id — Optional. (int)
User ID to retrieve cover image for.

Usage

  1. if ( !function_exists( 'bp_attachments_get_user_has_cover_image' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-attachments.php'; 
  3.  
  4. // User ID to retrieve cover image for. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_attachments_get_user_has_cover_image($user_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-attachments.php  
  1. function bp_attachments_get_user_has_cover_image( $user_id = 0 ) { 
  2. if ( empty( $user_id ) ) { 
  3. $user_id = bp_displayed_user_id(); 
  4.  
  5. $cover_src = bp_attachments_get_attachment( 'url', array( 
  6. 'item_id' => $user_id,  
  7. ) ); 
  8.  
  9. return (bool) apply_filters( 'bp_attachments_get_user_has_cover_image', $cover_src, $user_id );