The check_user_role
function accesses the global $current_user
with the goal of setting the first array item as a new var, $user_role
. In using array_shift()
, the first item in $current_user->roles
is removed. This causes problems if one attempts to continue working with $current_user->roles
.
Suggested solution: Set the $user_role
var using a method that does not alter the original array. One method might be to use reset()
as shown below.
Proposed solution:
File: class-mb-include-exclude.php
Line: 267
original:
$user_role = array_shift( $current_user->roles );
proposed:
$user_role = reset( $current_user->roles );