Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create activity entry on profile background upload
add_action("bppg_background_uploaded","bppg_record_activity");
function bppg_record_activity( $bg_image ) {
global $bp;
if ( !function_exists( 'bp_activity_add' ) )
return false;
$r = array(
'user_id' => $bp->loggedin_user->id,
'content' =>false ,
'action'=>sprintf("%s changed their profile background",bp_core_get_userlink( $bp->loggedin_user->id )),
'primary_link' => bp_core_get_userlink( $bp->loggedin_user->id ),
'component_name' => $bp->profile->id,
'component_action' =>"change_background",
'item_id' => $bp->loggedin_user->id,
'secondary_item_id' => false,
'recorded_time' => gmdate( "Y-m-d H:i:s" ),
'hide_sitewide' => false
);
extract( $r, EXTR_SKIP );
return bp_activity_add( array( 'user_id' => $user_id, 'content' => $content,'action'=>$action, 'primary_link' => $primary_link, 'component_name' => $component_name, 'component_action' => $component_action, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.