Skip to content

Commit

Permalink
Fix: more
Browse files Browse the repository at this point in the history
  • Loading branch information
frescoref committed Jun 23, 2023
1 parent d7b9fb2 commit cc01ec2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ function dismissNotice(dismissElement)
*
* @return bool
*/
public function is_users($args)
{
public function is_users($args): bool
{
// If user ids is empty we want this shown on all users.
if(!isset($args['user_ids']))
{
Expand All @@ -420,14 +420,19 @@ public function is_users($args)
/**
* @var WP_User $current_user
*/
$current_user = wp_get_current_user();
$current_user = \wp_get_current_user();

// Per user
if(!is_array($args['user_ids']) && $current_user->ID === $args['user_ids'])
{
return true;
}

if(!is_array($args['user_ids']))
{
return false;
}

if(count($args['user_ids']) < 1)
{
return true;
Expand Down

0 comments on commit cc01ec2

Please sign in to comment.