• Resolved candidek

    (@candidek)


    Hello,

    Is there any way we can get around the restriction of having to manually approve large numbers of imported users? We are using the “Import and export users and customers” plugin and the role is set up to auto-approve but it seems from your documentation that imported users always need to be approved? Any change we can bypass that?

    Thanks
    Candide

Viewing 6 replies - 1 through 6 (of 6 total)
  • @candidek

    it seems from your documentation that imported users always need to be approved

    What will happen if you try to login as one of the imported users?

    Thread Starter candidek

    (@candidek)

    The imported users are “pending review” when imported through a plugin… they then have to be manually approved

    @candidek

    This code snippet will auto-approve the user at first login if current status is awaiting_admin_review.

    add_filter( 'authenticate', 'my_submit_form_login_approval', 49, 3 );
    
    function my_submit_form_login_approval( $user, $username, $password ) {
    
        if ( isset( $user->ID ) ) {
    
            um_fetch_user( $user->ID );
    
            if( um_user( 'account_status' ) == 'awaiting_admin_review' ) {
                update_user_meta( $user->ID, 'account_status', 'approved' ); 
                UM()->user()->remove_cache( $user->ID );
                um_fetch_user( $user->ID );
            }
        }
        return $user;
    }

    Add the code snippet to your child-theme’s functions.php file or
    use the “Code Snippets” Plugin:

    https://ww.wp.xz.cn/plugins/code-snippets/

    Thread Starter candidek

    (@candidek)

    Thanks @missveronicatv – that’s a very helpful code snippet though ideally I prefer a root fix as we have two membership types and only one is auto-approved and the second requires an admin to review manually. The auto-approve works when we create individual new user accounts but it’s the import that has the limitation…

    Thanks!

    @candidek

    You should ask the Import Plugin Developer to make the User approved instead of setting acount_status to awaiting_admin_review.

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Auto approve imported users’ is closed to new replies.