Skip to content

Commit

Permalink
Merge pull request #21881 from kfeinUI/patch-1
Browse files Browse the repository at this point in the history
class-register-capabilities.php in_array() TypeError fix
  • Loading branch information
vraja-pro authored Dec 4, 2024
2 parents 6de7059 + bd10258 commit 5cb155f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions admin/capabilities/class-register-capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public function map_meta_cap_for_seo_manager( $caps, $cap ) {
return $caps;
}

if ( ! is_array( $user->roles ) ) {
return $caps;
}

// User must be of role wpseo_manager.
if ( ! in_array( 'wpseo_manager', $user->roles, true ) ) {
return $caps;
Expand Down

0 comments on commit 5cb155f

Please sign in to comment.