Hello,
I have the following code:
add_action(
'rwmb_profile_after_process',
function( $config, $user_id ) {
if (!isset($user_id))
echo 'user_id not set<br />';
if (empty($user_id))
echo 'user_id empty<br />';
echo '<pre>';
echo var_dump($user_id);
echo '</pre>';
if ('member_personal' === $config['id']) {
$user = wp_get_current_user();
$userMeta = get_userdata($user->ID);
echo '<pre>';
echo var_dump($user);
echo '</pre>';
$user->set_role('partenaire');
echo '<pre>';
echo var_dump($user);
echo '</pre>';
echo '<pre>';
echo var_dump($userMeta);
echo '</pre>';
mail($userMeta->user_email,'New submission', print_r($userMeta, TRUE));
die();
}
},
10,
2);
Who always return: user_id not set and user_id empty.
Is it normal ? And if yes, how can i get the user id of the new user ?
Thanks for answer.