bp_gifts_record_activity

The Buddypress Gifts Latest 2014 bp gifts record activity function.

Description

bp_gifts_record_activity( (string) $args = '' ); 

Parameters (1)

0. $args — Optional. (string) => ''
The args.

Usage

  1. if ( !function_exists( 'bp_gifts_record_activity' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress-gifts-latest-2014/includes/bp-gifts-core.php'; 
  3.  
  4. // The args. 
  5. $args = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_gifts_record_activity($args); 
  9.  

Defined (1)

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

/includes/bp-gifts-core.php  
  1. function bp_gifts_record_activity( $args = '' ) { 
  2.  
  3. global $bp; 
  4.  
  5.  
  6.  
  7. if ( !function_exists( 'bp_activity_add' ) ) 
  8.  
  9. return false; 
  10.  
  11.  
  12.  
  13. $defaults = array( 
  14.  
  15. 'id' => false,  
  16.  
  17. 'user_id' => $bp->loggedin_user->id,  
  18.  
  19. 'action' => '',  
  20.  
  21. 'content' => '',  
  22.  
  23. 'primary_link' => '',  
  24.  
  25. 'component' => 'gifts',  
  26.  
  27. 'type' => false,  
  28.  
  29. 'item_id' => false,  
  30.  
  31. 'secondary_item_id' => false,  
  32.  
  33. 'recorded_time' => gmdate( "Y-m-d H:i:s" ),  
  34.  
  35. 'hide_sitewide' => false 
  36.  
  37. ); 
  38.  
  39.  
  40.  
  41. $r = wp_parse_args( $args, $defaults ); 
  42.  
  43. extract( $r ); 
  44.  
  45.  
  46. return bp_activity_add( array( 'id' => $id, 'user_id' => $user_id, 'action' => $action, 'content' => $content, 'primary_link' => $primary_link, 'component' => $component, 'type' => $type, 'item_id' => $item_id, 'secondary_item_id' => $secondary_item_id, 'recorded_time' => $recorded_time, 'hide_sitewide' => $hide_sitewide ) ); 
  47.