• Resolved bauralex

    (@bauralex)


    Hi

    The Plugin works relly good but I have 2 questions/problems with my TML installation.

    First:
    I’ve set the Admin Moderation for new users.
    Now when I as an admin approve a pending user, the new user as no user role. I’m trying to set a new user role when the user is approved wit hthe following code in my functions.php

    function set_role_on_activation( $user_id ) {
        if ($pending_role = get_user_meta( $user_id, 'pending_role', true ) ) {
        	$user = new WP_User( $user_id );
        	$user->set_role('subsriber');
        	unset( $user );
       	}
    }
    add_filter( 'tml_new_user_activated', 'set_role_on_activation' );

    But sadly that doesn’t work… I’ve also tried to give an js alert but I think the hook is not working. Can someone point me to the right direction?

    Second:
    The users can login with Email and with the Username. Is it possible the let the user change his email address with this setting?

    Thanks for your answer

    Alex

    https://www.ads-software.com/plugins/theme-my-login/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    1. TML will auto-assign the user to the default role setting in the core WP settings.
    2. No, not out of the box.
    Thread Starter bauralex

    (@bauralex)

    Hi I have again a question to this topic…

    My default role is is pending, so everyone that does the registration process gets the status pending…
    The site admin has to manually approve each User with the role pending and after this approval the role should be ‘subscriber’

    How can I do that?

    I saw your answer from here https://www.ads-software.com/support/topic/register-form-for-specific-role/ and so I tried this snippet:

    function set_role_on_activation( $user_id ) {
    	$user = new WP_User( $user_id );
    	$user->set_role('subscriber');
    	unset( $user );
    }
    add_action( 'user_registered', 'set_role_on_activation' );

    but it doesn’t work either

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User Approved Hook & User Email Change’ is closed to new replies.