• Resolved supertomate

    (@supertomate)


    Is it possible to disable verification only when a user is registered by an admin account?
    I tried to use the code that was in a NSL topic and add the is_admin() condition but I noticed that no mail was sent even when creating an account on the frontend.

    add_filter('user_verification_enable','user_verification_enable_nsl', 90);
    function user_verification_enable_nsl($is_enable){
    
        if (is_admin()) {
          return 'no';
        }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you tried by current_user_can( 'manage_options' ) instead of is_admin()

    Please try the following code.

    
    add_filter('user_verification_enable','user_verification_enable_nsl', 90);
    function user_verification_enable_nsl($is_enable){
    
        if (current_user_can( 'manage_options' )) {
          return 'no';
        }
    }
    • This reply was modified 2 years, 11 months ago by hasanrang05.
    • This reply was modified 2 years, 11 months ago by hasanrang05.
    Thread Starter supertomate

    (@supertomate)

    Hello and thank you very much for this quick answer.
    I just tried it and unfortunately it didn’t work 🙁
    I’m sure it’s because we don’t use the basic wordpress system but an ajax call + code in the functions.php file.

    It does block the sending of emails in the backend but unfortunately also for the users in the frontend

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘disable user verification’ is closed to new replies.