Skip to content

Commit

Permalink
Use instanceof instead of isset()
Browse files Browse the repository at this point in the history
  • Loading branch information
azaozz committed Jul 17, 2024
1 parent 901a86e commit 0523acd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions classic-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,12 @@ public static function user_settings( $user = null ) {
global $user_can_edit;
$settings = self::get_settings( 'update' );

if (
! $user_can_edit ||
! $settings['allow-users']
) {
if ( ! $user_can_edit || ! $settings['allow-users'] ) {
return;
}

if ( isset( $user->ID ) && $user->ID > 0 ) {
$user_id = $user->ID;
if ( $user instanceof WP_User ) {
$user_id = (int) $user->ID;
} else {
$user_id = 0;
}
Expand Down

0 comments on commit 0523acd

Please sign in to comment.