Skip to content

Commit

Permalink
Merge pull request #6 from digiom/dev
Browse files Browse the repository at this point in the history
Fix: more
  • Loading branch information
frescoref authored Jun 23, 2023
2 parents 1bc3a69 + cc01ec2 commit 8b85908
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 8b85908

Please sign in to comment.