use this hook:
do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors );
found in:
buddypress\bp-xprofile\bp-xprofile-screens.php L. 125
Thanks @shanebp but I’m fairly new to WP and BP. This is what I do:
1. edit.php: At the end of file just after “do_action( ‘bp_after_profile_edit_content’ );”
I’m adding your line:
do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors );
2. functions.php:
function hook_bp_profileupdate( $ids, $errors ) {
// CALL API AND POST THE IDs
print_r( $ids );
}
add_action( 'xprofile_updated_profile', 'hook_bp_profileupdate', 0, 2 );
Nothing happens.
Can’t EDIT my posts on the forums anymore…
So my question is: what’s this $posted_field_ids variable? How does it get populated; it’s always NULL, same as $_POST (I’m in edit.php)
Remove all the changes listed above that you made to edit.php.
In functions.php, paste this:
function something_updated_profile( $user_id, $posted_field_ids, $errors ) {
if ( empty( $errors ) ) {
print_r( $posted_field_ids );
echo "<br>user id: " . $user_id . "<br>";
print_r( $_POST );
}
}
add_action('xprofile_updated_profile', 'something_updated_profile', 1, 3);
read this:
https://codex.wordpress.org/Function_Reference/do_action
I read that page before. Still nothing’s echoed.
I removed all my lines from edit.php there’s just functions.php with your above code, but where does do_action() go now? Still don’t get how $posted_field_ids is populated
I re-added this in the edit.php inside the while ( bp_profile_fields() )
do_action( 'xprofile_updated_profile', bp_displayed_user_id(), bp_get_the_profile_field_id(), trim(strip_tags(bp_get_the_profile_field_value())) );
Now… Do you know what is the hook do to upon user registration?