Filters Associated With Login/Registration

Filter: wp_travel_process_login_errors #

Filter for login form validation error.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$validation_error, $username, $password

Example:

function prefix_wp_travel_process_login_errors( $validation_error, $username, $password ) {
    $validation_error = ‘ERROR VALIDATION HERE’;
    return $validation_error;
}
add_filter( 'wp_travel_process_login_errors', 'prefix_wp_travel_process_login_errors', 12, 3 );

Filter: wp_travel_login_credentials #

Filter for login process credentials.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$creds

Example:

function prefix_wp_travel_login_credentials( $creds ) {
    $creds[‘remember’] = ‘yes’;
    return $creds;
}
add_filter( 'wp_travel_login_credentials', 'prefix_wp_travel_login_credentials' );

Filter: wp_travel_login_redirect #

Filter for login redirect.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$handle_args, $user

Example:

function prefix_wp_travel_login_credentials( $handle_args, $user ){
    $handle_args = remove_query_arg( 'wp_travel_error',
    $_POST['redirect'] )
    return $handle_args;
}
add_filter( 'wp_travel_login_redirect', 'prefix_wp_travel_login_redirect', 12, 2 );

Filter: wp_travel_login_errors #

Filter for login error notice.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
Default is ‘__( ‘Error :Invalid Username or Password’, ‘wp-travel’ ).’

Example:

function prefix_wp_travel_login_errors() {
    return ‘__( '<strong>Error :</strong>Username/Password not
    valid.', 'wp-travel' )’;
}
add_filter( 'wp_travel_login_errors', 'prefix_wp_travel_login_errors' );

Filter: wp_travel_process_registration_errors #

Filter for user registration form validation error.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$validation_error, $username, $password, $email

Example:

function prefix_wp_travel_process_registration_errors( $validation_error, $username, $password, $email ) {
    $validation_error = ‘ERROR VALIDATION HERE’;
    return $validation_error;
}
add_filter( 'wp_travel_process_registration_errors', 'prefix_wp_travel_process_registration_errors', 12, 3 );

Filter: wp_travel_registration_auth_new_customer #

Filter for registration authentication for new customers enable/disable.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
Default is true , $new_customer

Example:

function prefix_wp_travel_registration_auth_new_customer() {
    return false;
}
add_filter( 'wp_travel_registration_auth_new_customer', 'prefix_wp_travel_registration_auth_new_customer' );

Filter: wp_travel_register_redirect #

Filter for user registration redirect.

Source

File: /inc/class-wp-travel-form-handler.php
Used by: /inc/class-wp-travel-form-handler.php

Parameters
$handle_args, $user

Example:

function prefix_wp_travel_register_redirect( $handle_args, $user ){
    $handle_args = remove_query_arg( 'wp_travel_error',
    $_POST['redirect'] )
    return $handle_args;
}
add_filter( 'wp_travel_register_redirect', 'prefix_wp_travel_register_redirect', 12, 2 );

Filter : wp_travel_get_username_from_email #

Filter to get username from user email.

Source

File: /inc/class-wp-travel-user-account.php
Used by: /inc/class-wp-travel-user-account.php

Parameters
Default is true.

Example:

function prefix_wp_travel_get_username_from_email() {
    return false;
}
add_filter( 'wp_travel_get_username_from_email', 'prefix_wp_travel_get_username_from_email' );

Filter: allow_password_reset #

Filter to allow password reset.

Source

File: /inc/class-wp-travel-user-account.php
Used by: /inc/class-wp-travel-user-account.php

Parameters
Default is true, $user_id

Example:

function prefix_allow_password_reset() {
    return false;
}
add_filter( 'allow_password_reset', 'prefix_allow_password_reset' );

Filter: wp_travel_before_user_registration_email #

WP Travel user email arguments before registration.

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
$args

Example:

function prefix_wp_travel_before_user_registration_email( $args ) {
    $args[‘user_email’] = ‘test@test.com’;
    return $args;
}
add_filter( 'wp_travel_before_user_registration_email', 'prefix_wp_travel_before_user_registration_email' );

Filter: wp_travel_registration_errors #

User registration errors.

Source

File: /inc/wp-travel-user-functions.php
Used by: /inc/wp-travel-user-functions.php

Parameters
$errors, $username, $email

Example:

function prefix_wp_travel_registration_errors( $errors, $username, $email ) {
    // Code here for errors.
    return $errors;
}
add_filter( 'wp_travel_registration_errors', 'prefix_wp_travel_registration_errors', 12, 3 );

Filter: wp_travel_new_customer_data #

Newly registered user data before inserting to database.

Source

File: /inc/wp-travel-user-functions.php
Used by: /inc/wp-travel-user-functions.php

Parameters
$data

Example:

function prefix_wp_travel_new_customer_data( $data ) {
    $data[‘role’] = ‘wp-travel-editor’;
    return $data;
}
add_filter( 'wp_travel_new_customer_data', 'prefix_wp_travel_new_customer_data' );

Filter: wp_travel_lostpassword_url #

Lost password endpoint url.

Source

File: /inc/wp-travel-user-functions.php
Used by: /inc/wp-travel-user-functions.php

Parameters
$url, $default_url

Example:

function prefix_wp_travel_lostpassword_url( $url, $default_url ) {
    // Code here for url.
    return $url;
}
add_filter( 'wp_travel_lostpassword_url', 'prefix_wp_travel_lostpassword_url', 12, 2);

Filter: wp_travel_lost_password_message #

WP Travel lost your password message.

Source

File: /templates/form-lostpassword.php
Used by: /templates/form-lostpassword.php,
                 /templates/account/lostpassword-confirm.php

Parameters
Default is ‘esc_html__( ‘Lost your password? Please enter your username or email
address. You will receive a link to create a new password via email.’, ‘wp-travel’ ) ’.

Example:

function prefix_wp_travel_lost_password_message( $comment_form ) {
    return esc_html__( ‘Please enter your email or username to
    create new password here and you will receive email.’, ‘wp-travel’
    );
}
add_filter( 'wp_travel_lost_password_message', 'prefix_wp_travel_lost_password_message' );

Filter: wp_travel_reset_password_message #

WP Travel reset your password message.

Source

File: /templates/form-reset-password.php
Used by: /templates/form-reset-password.php

Parameters
Default is ‘esc_html__( ‘Enter a new password below.’, ‘wp-travel’ ) ’.

Example:

function prefix_wp_travel_reset_password_message( $comment_form ) {
    return esc_html__( ‘Please enter new password.’, ‘wp-travel’
    );
}
add_filter( 'wp_travel_reset_password_message', 'prefix_wp_travel_reset_password_message' );