rwmb_profile_after_process don't give user_id

Support MB User Profile rwmb_profile_after_process don't give user_id

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14677
    RibanoRibano
    Participant

    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.

    #14699
    Anh TranAnh Tran
    Keymaster

    Hi Ribano,

    Let me check that. In the latest version, I removed the user_id in some places to fix the security bug. I'll check this again.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.