delete_pic_cover_group

The BuddyPress cover delete pic cover group function.

Description

delete_pic_cover_group( $activity_id ); 

Parameters (1)

0. $activity_id
The activity id.

Usage

  1. if ( !function_exists( 'delete_pic_cover_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 = delete_pic_cover_group($activity_id); 
  9.  

Defined (1)

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

/bp-cover-group.php  
  1. function delete_pic_cover_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. wp_delete_attachment( $attachment_id, true); 
  7. groups_delete_groupmeta($group_id, 'bp_cover_group');  
  8. groups_delete_groupmeta($group_id, 'bp_cover_group_position');  
  9. bp_activity_delete( array( 'id' => $activity_id, 'item_id' => $group_id ) ); 
  10. BP_Activity_Activity::delete_activity_meta_entries( $activity_id );