• Resolved candus

    (@candus)


    Hi @hornero and dear @carazo
    there is an filter hook in new version
    apply_filters( ‘clean_login_invalid_email’, false, $email )
    but how can we use it?
    please explain it with an example and in more detail, good man

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Javier Carazo

    (@carazo)

    Good morning @candus,

    This filter is created to make custom email validation.

    You get 2 parameters:

    apply_filters( 'clean_login_invalid_email', false, $email ) )
    

    The default return (false) and email. You can do any special validation with this second parameter.

    If you have any doubt, please let me know.

    Hi @carazo

    • This reply was modified 4 years, 7 months ago by parsmdor.
    Thread Starter candus

    (@candus)

    Hi el @carazo
    Suppose I just want Gmail and Yahoo to register. What code should I write?
    This latest filter is very important and vital. Why not explain it in full? This can greatly help the popularity of the plugin. I suggest you explain with examples and sample codes so that all users can see and know.

    • This reply was modified 4 years, 7 months ago by candus.
    Plugin Author Javier Carazo

    (@carazo)

    @candus,

    You can use it using this as any other hook, if you use hook and you know PHP you will know easy to do it.

    We cannot made examples for every problem because your problem won’t be the same than exacty than other.

    Something like:

    add_filter( 'clean_login_invalid_email', 'cod_clean_login_invalid_email' );
    function cod_clean_login_invalid_email( $retorno, $email ){
    // do the stuff here
    
    return $retorno;
    }

    Hola @carazo
    This is a key request.
    I want users to be able to register only with Gmail and Yahoo. Otherwise, they will not be registered. Write a simple code to understand.

    Plugin Author Javier Carazo

    (@carazo)

    Something like it:

    add_filter( 'clean_login_invalid_email', 'cod_clean_login_invalid_email' );
    function cod_clean_login_invalid_email( $retorno, $email ){
    $retorno = false;
    
    if( strpos( $email, 'gmail') === FALSE && strpos( $email, 'yahoo') === FALSE )
      return true;
    
    return $retorno;
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to use clean_login_invalid_email filter?’ is closed to new replies.