• I wrote following function to accept ‘user’ role created at registration, but unfortunately it doesn’t auto-approve this user

    function sww_approve( $user_id ) {
    	$roles = get_userdata( $user_id )->roles;
    	if ( 'pending' == pw_new_user_approve()->get_user_status( $user_id ) && in_array( 'user', $roles ) ) {
    		pw_new_user_approve()->update_user_status( $user_id, 'approve' );
    	}
    }
    add_action( 'new_user_approve_approve_user', 'sww_approve' );

    Does anybody knows, what is wrong here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPExperts.io

    (@wpexpertsio)

    Hi @j3th,

    We are pleased to announce important news. New user approve has been acquired by WP Experts. If being a user, you have any queries and issues, then we are solving your problems here.

    Thanks

    • This reply was modified 4 years, 10 months ago by WPExperts.io.
    Plugin Author WPExperts.io

    (@wpexpertsio)

    This thread has been marked as resolved due to lack of activity.

    You’re always welcome to open a new topic.

    Thanks for understanding!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Accept specific role’ is closed to new replies.