bp_attachments_get_group_has_cover_image

Does the group has a cover image?.

Description

bp_attachments_get_group_has_cover_image( (int) $group_id = 0 ); 

Parameters (1)

0. $group_id — Optional. (int)
Group ID to check cover image existence for.

Usage

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

Defined (1)

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

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