i want to update a custom user_meta field when a user uploaded a new image (not avatar).
Working code for avatar upload
add_action('xprofile_avatar_uploaded', 'callback');
function callback($user_id, $type)
{
// $activity_id = <- the activity from the uploded image.
update_user_meta($user_id, 'image_'.$activity_id, '1');
}
When you are using rtMedia plugin for buddypress and upload photos provide a action rtmedia_after_add_media with three arguments you can handle your customization.
I overrode
bp_core_avatar_handle_upload
with the following function. It calls bp_core_avatar_handle_upload within it, but avoids an infinite loop by setting and checking the value of a global variable.