Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions includes/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,20 @@ function rc_process_login_form() {

$redirect = ! empty( $_POST['rc_redirect'] ) ? $_POST['rc_redirect'] : home_url();

wp_signon( array(
$wp_signon_result = wp_signon( array(
'user_login' => $user->user_login,
'user_password' => $_POST['rc_user_pass'],
'remember' => isset( $_POST['rc_user_remember'] )
) );

wp_safe_redirect( esc_url_raw( $redirect ) );
if( is_wp_error($wp_signon_result) ){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add spaces around the $wp_signon_result variable?

rc_errors()->add( 'wp_signin_error' , $wp_signon_result->get_error_message(), 'login' );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's set the error code to $wp_signon_result->get_error_code() instead of wp_signin_error.

$errors = rc_errors()->get_error_messages();
}else{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a space between } and else ?

wp_safe_redirect( esc_url_raw( $redirect ) );

exit;
exit;
}
}
}
add_action( 'init', 'rc_process_login_form' );
Expand Down Expand Up @@ -660,4 +665,4 @@ function rc_validate_user_data( array $data ) {
}

return $user;
}
}