bp_activity_custom_update

Filters activity object for BuddyPress core and plugin authors before posting activity update.

Description

apply_filters( 'bp_activity_custom_update', (unknown) $post_object, (unknown) $post_item_id, (unknown) $post_content ); 

Parameters (3)

0. $post_object (unknown)
The post object.
1. $post_item_id (unknown)
The post item id.
2. $post_content (unknown)
The post content.

Usage

To run the hook, copy the example below.
  1. $post_object = apply_filters( 'bp_activity_custom_update', $post_object, $post_item_id, $post_content ); 
  2.  
  3. if ( !empty( $post_object ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the bp_activity_custom_update callback 
  2. function filter_bp_activity_custom_update( $post_object, $post_item_id, $post_content ) { 
  3. // make filter magic happen here... 
  4. return $post_object
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'bp_activity_custom_update', 'filter_bp_activity_custom_update', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'bp_activity_custom_update', 'filter_bp_activity_custom_update', 10, 3 ); 

Defined (3)

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

/bp-themes/bp-default/_inc/ajax.php  
  1. $activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] ); 
/bp-templates/bp-legacy/buddypress-functions.php  
  1. $activity_id = apply_filters( 'bp_activity_custom_update', false, $object, $item_id, $_POST['content'] ); 
/bp-activity/bp-activity-actions.php  
  1. $activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );