Last active
November 4, 2015 17:15
-
-
Save pranali333/e3aa4901f79814bb26fc to your computer and use it in GitHub Desktop.
Usage of filter : bp_activity_new_update_content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use this filter in your theme's functions.php file if you want to filter the content of new activity. | |
// For example below code will append username to current activity item. | |
// define the bp_activity_new_update_content callback | |
function filter_bp_activity_new_update_content( $activity_content ) | |
{ | |
// Append additional content here... | |
$user_info = get_userdata(get_current_user_id()); | |
$activity_content = 'I am user : '.$user_info->user_login." ".$activity_content; | |
// remove the filter | |
remove_filter( 'bp_activity_new_update_content', 'filter_bp_activity_new_update_content', 10, 1 ); | |
return $activity_content; | |
} | |
// add the filter | |
add_filter( 'bp_activity_new_update_content', 'filter_bp_activity_new_update_content', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment