Currently this does not exist in the plugin. I don’t think I’d add a way to store a plain-text password in another system and then pass it into WordPress.
Yeah that’s probably best. How would I, after the new user is saved in WP run a function based on the new user id and save that result to the user. I tried using ‘object_sync_for_salesforce_pull_success’ but that doesn’t run after a new user is created.
Hm well there is a object_sync_for_salesforce_set_more_user_data hook. You might be able to use that? There’s a bit of documentation on it.
Not sure if I’m using that function right…
add_action( 'object_sync_for_salesforce_set_more_user_data', 'save_more_my_user', 10, 3 );
function save_more_my_user( $user_id, $params, $action ) {
$rp_key = get_reset_key( $user_id );
$result = array(
'data' => array(
'rp_key' => $rp_key,
),
);
return $result;
}
rp_key is a field on the usermeta table.
Also what is the best way to see variable values from these functions?
Well, in this case it the hook you’re using isn’t a filter, it’s an action. There’s a helpful answer about the differences, but mainly you should know that an action doesn’t take a return value. That is, the plugin isn’t going to do anything with the action result. Probably the documentation should be more clear about this (but in any case, we don’t really provide support for the developer hooks). I’d be happy to add the example of whatever you’re doing with it if you get it working to the docs though, if you’d want to add a pull request.
But in other words, you have to use your function to perform any other actions you want to perform with those variables, rather than relying on the plugin to do something with it for you.
As for seeing the values, the best way is to do something like error_log( print_r( $params, true ) ); or error_log( 'user id is ' . $user_id ); depending on which you want to see.