rwmb_frontend_validate and user_login

Support MB Frontend Submission rwmb_frontend_validate and user_loginResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #33104
    Nicholas CoxNicholas Cox
    Participant

    Hi

    is it possible to target the user_name/user_login inside the rwmb_frontend_validate filter?

    public function userRegisterFormValidation() {
    
    add_filter( 'rwmb_frontend_validate', function( $validate, $config ) {
        if ( 'dc-user' !== $config['id'] ) {
            return $validate;
        }
        if ( $_POST['user_login'] == 'example' ) {
            $validate = 'custom message'; 
        }
        return $validate;
    }, 10, 2 );
    }
    #33116
    Long NguyenLong Nguyen
    Moderator

    Hi Nicholas,

    You can use the filter rwmb_profile_validate to validate the user field. It works like the filter rwmb_frontend_validate. Read more on the documentation https://docs.metabox.io/extensions/mb-user-profile/#form-fitlers

    #33130
    Nicholas CoxNicholas Cox
    Participant

    ok great thanks for your help

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.