• Resolved deebalturk

    (@deebalturk)


    Hello , i am migrating from ER Forms to Ultimate Member Plugin and all the old users (a mix of approved and rejected users) are being automatically approved

    any way to stop that?

Viewing 5 replies - 1 through 5 (of 5 total)
  • @deebalturk

    I tried to find the meta_key for your User status in ER Forms
    and found this where it’s a meta_key active which is 0 for an inactive user.

    https://plugins.svn.ww.wp.xz.cn/easy-registration-forms/trunk/includes/class-user.php

    If this is true, you can try this code snippet which will make all inactive ER Forms Users UM inactive too. The User status update will be made when you display an UM page.
    After the update remove the code snippet.

    add_action( 'init', 'update_er_forms_inactive_users' );
    
        function update_er_forms_inactive_users() {
    
            $inactive_users = get_users( array( 'meta_key'   => 'active', 
                                                'meta_value' => '0', 
                                                'fields'     => 'user_id',
                                        ));
    
            foreach( $inactive_users as $inactive_user ) {
                update_user_meta( $inactive_user, 'account_status', 'inactive' );
                UM()->user()->remove_cache( $inactive_user );
            }
        }

    Install the code snippet into your active theme’s functions.php file
    or use the “Code Snippets” plugin.

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

    Thread Starter deebalturk

    (@deebalturk)

    thank you i will try it and get back to you

    Thread Starter deebalturk

    (@deebalturk)

    hello, it didnt work

    @deebalturk

    Yes you are right, replace the code snippet with this updated code snippet.

    add_action( 'init', 'update_er_forms_inactive_users' );
    
        function update_er_forms_inactive_users() {
    
            $inactive_users = get_users( array( 'meta_key'   => 'erf_active', 
                                                'meta_value' => '0', 
                                                'fields'     => 'user_id',
                                        ));
    
            foreach( $inactive_users as $inactive_user ) {
                update_user_meta( $inactive_user, 'account_status', 'inactive' );
                UM()->user()->remove_cache( $inactive_user );
            }
        }
    Plugin Support andrewshu

    (@andrewshu)

    Hi @deebalturk

    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 if any other questions come up and we’d be happy to help. 🙂

    Regards

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

The topic ‘migrating to Ultimate Member Plugin’ is closed to new replies.