delete_pic_cover

The BuddyPress cover delete pic cover function.

Description

delete_pic_cover( $activity_id ); 

Parameters (1)

0. $activity_id
The activity id.

Usage

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

Defined (1)

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

/bp-cover.php  
  1. function delete_pic_cover($activity_id ) { 
  2. global $bp;  
  3. $user_id=bp_loggedin_user_id();  
  4. $activity_id = $_POST['activity_id'];  
  5. $attachment_id = bp_activity_get_meta( $activity_id, 'bp_cover_activity', true );  
  6. wp_delete_attachment( $attachment_id, true); 
  7. delete_user_meta($user_id, 'bp_cover');  
  8. delete_user_meta($user_id, 'bp_cover_position');  
  9. bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $bp->loggedin_user->id ) ); 
  10. BP_Activity_Activity::delete_activity_meta_entries( $activity_id );