Fix deprecation notice when validating a WP_User object.
This commit is contained in:
@ -86,8 +86,11 @@ class Unique extends Rule {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
} // end if;
|
} // end if;
|
||||||
|
if ( $existing instanceof \WP_User) {
|
||||||
|
$id = $existing->ID;
|
||||||
|
} else {
|
||||||
$id = method_exists( $existing, 'get_id' ) ? $existing->get_id() : $existing->id;
|
$id = method_exists( $existing, 'get_id' ) ? $existing->get_id() : $existing->id;
|
||||||
|
}
|
||||||
|
|
||||||
return absint($id) === absint($self_id);
|
return absint($id) === absint($self_id);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user