select_pic_for_cover

The BuddyPress cover select pic for cover function.

Description

select_pic_for_cover( $activity_id ); 

Parameters (1)

0. $activity_id
The activity id.

Usage

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

Defined (1)

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

/bp-cover.php  
  1. function select_pic_for_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. $fileurl = wp_get_attachment_image_src( $attachment_id ); 
  7. update_user_meta($user_id, 'bp_cover', $fileurl[0]);  
  8. delete_user_meta($user_id, 'bp_cover_position');  
  9.