FIX added check to ensure user roles are an array before verifying administrator status in screen options
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
c26617174e
commit
481aac71ce
|
|
@ -260,7 +260,7 @@ function reinsert_submitdiv_meta_box()
|
||||||
function de_activite_screen_options()
|
function de_activite_screen_options()
|
||||||
{
|
{
|
||||||
$current_user = wp_get_current_user();
|
$current_user = wp_get_current_user();
|
||||||
if (!empty($current_user->roles) && $current_user->roles[0] !== 'administrator') {
|
if (!empty($current_user->roles) && is_array($current_user->roles) && $current_user->roles[0] !== 'administrator') {
|
||||||
add_filter('screen_options_show_screen', '__return_false');
|
add_filter('screen_options_show_screen', '__return_false');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user