Use the ‘xprofile_updated_profile’ hook
function josh_profile_check( $user_id, $posted_field_ids, $errors ) {
/* check $posted_field_ids to see if one of the fields you are interested in has changed
if yes, then use bp_activity_add to add to activity stream
*/
}
add_action( 'xprofile_updated_profile', 'josh_profile_check', 10, 3 );
bp_activity_add
Thanks! Would I put this in the Functions file in my child-theme or in the buddypress/bp-activity/bp-activity-functions.php file? If it is in the activity functions where should I put it? Sorry I am still learning buddypress.
Never put code into the buddypress plugin files.
Use your theme functions.php or use bp-custom.php.
Ok yes sorry I knew that. I tried to add it to my functions.php and I updated my profile but it did not show in the activity feed. I would like it to show in the activity feed if anyone updates their profile via the xprofile fields. It looks like from your code that it would only show if I update my profile. Any thoughts?
> Any thoughts?
Use a service like gist to show the code that you tried.
I tried the exact code that you put in your first response. I put it in my Functions file then updated one of the xProfile fields and it was not in the activity feed.
Yikes – that was just a skeleton that needs actual code in the function.
Given your code ability and the number of code requests you’ve recently made on these forums,
I recommend that you post a job listing here.