Custom Fields
Re-Envisioned
Support MB User Profile rwmb_profile_after_process don't give user_id

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 3 months ago.

  • Creator
    Topic
  • #14677

    Ribano
    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.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #14699

    Anh 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 1 replies (of 1 total)

You must be logged in to reply to this topic.