Skip to content

Commit

Permalink
logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sdobreff committed Jun 4, 2024
1 parent 8d3e6df commit 0234e61
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions includes/classes/class-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ public static function notice_hiding_allowed_for_current_user() {
return false;
}

// phpcs:disable WordPress.PHP.StrictInArray
$settings = self::get_settings();
if ( ! array_key_exists( 'visibility', $settings ) || ! array_key_exists( 'choice', $settings['visibility'] ) ) {
return true;
Expand All @@ -225,14 +224,14 @@ public static function notice_hiding_allowed_for_current_user() {
if ( 'hide-for-selected' === $settings['visibility']['choice']
&& array_key_exists( 'hide-users', $settings['visibility'] )
&& is_array( $settings['visibility']['hide-users'] )
&& ! in_array( get_current_user_id(), $settings['visibility']['hide-users'] ) ) {
&& in_array( get_current_user_id(), $settings['visibility']['hide-users'] ) ) {
return false;
}

if ( 'show-for-selected' === $settings['visibility']['choice']
&& array_key_exists( 'show-users', $settings['visibility'] )
&& is_array( $settings['visibility']['show-users'] )
&& in_array( get_current_user_id(), $settings['visibility']['show-users'] ) ) {
&& ! in_array( get_current_user_id(), $settings['visibility']['show-users'] ) ) {
return false;
}

Expand Down

0 comments on commit 0234e61

Please sign in to comment.