Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbrajesh/1066864 to your computer and use it in GitHub Desktop.
Save sbrajesh/1066864 to your computer and use it in GitHub Desktop.
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