Skip to content

Add instance type check #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
7 changes: 3 additions & 4 deletions email-verify.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ public function generate_token(){
/**
* Prevents users from loggin in, if they have not verified their email address
*
* @param WP_User $user
* @param str $username
* @param null|WP_User|WP_Error $user
* @param str $username
*/
public function check_active_user( $user, $username ){
$needs_verification = $this->needs_validation( $user->ID );
if( $needs_verification !== false ) {
if( $user instanceof WP_User && $this->needs_validation( $user->ID ) !== false ) {
$username = esc_attr($username);
return new WP_Error( 'email_not_verified', sprintf(
__('You have not verified your email address, please check your email and click on verification link we sent you, <a href="#resend" onClick="%s">Re-send the link</a>', 'dwverify'),
Expand Down