diff --git a/admin/capabilities/class-register-capabilities.php b/admin/capabilities/class-register-capabilities.php index 6cf248d8f79..04aee8c0e0a 100644 --- a/admin/capabilities/class-register-capabilities.php +++ b/admin/capabilities/class-register-capabilities.php @@ -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;