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.
- $post_object = apply_filters( 'bp_activity_custom_update', $post_object, $post_item_id, $post_content );
- if ( !empty( $post_object ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_activity_custom_update callback
- function filter_bp_activity_custom_update( $post_object, $post_item_id, $post_content ) {
- // make filter magic happen here...
- return $post_object;
- };
- // add the filter
- add_filter( 'bp_activity_custom_update', 'filter_bp_activity_custom_update', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- $activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] );
- /bp-templates/bp-legacy/buddypress-functions.php
- $activity_id = apply_filters( 'bp_activity_custom_update', false, $object, $item_id, $_POST['content'] );
- /bp-activity/bp-activity-actions.php
- $activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );