select_cover_for_group

The BuddyPress cover select cover for group function.

Description

select_cover_for_group( $activity_id ); 

Parameters (1)

0. $activity_id
The activity id.

Usage

  1. if ( !function_exists( 'select_cover_for_group' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-cover/bp-cover-group.php'; 
  3.  
  4. // The activity id. 
  5. $activity_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = select_cover_for_group($activity_id); 
  9.  

Defined (1)

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

/bp-cover-group.php  
  1. function select_cover_for_group($activity_id ) { 
  2. global $bp;  
  3. $group_id=$bp->groups->current_group->id;  
  4. $activity_id = $_POST['activity_id'];  
  5. $attachment_id = bp_activity_get_meta( $activity_id, 'all_bp_cover_group', true ); 
  6. $fileurl = wp_get_attachment_image_src( $attachment_id );  
  7. groups_update_groupmeta($group_id, 'bp_cover_group', $fileurl[0]);  
  8. groups_update_groupmeta($group_id, 'bp_cover_group_position', 0);  
  9. /**groups_record_activity( array( 
  10. 'action' => sprintf( __( '%s changed their cover group %s', 'bp-cover' ),  
  11. bp_core_get_userlink( $bp->loggedin_user->id ),  
  12. '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>') ,  
  13. 'type' => 'cover_changed',  
  14. 'item_id' => $group_id,  
  15. 'content' =>bp_cover_group_get_image_scr() ,  
  16. 'item_id' => $group_id,  
  17. ) );*/  
  18.