Quick bug report for you:
When the primary role, returned by
wlcms_get_current_user_role isn't one of the standard WordPress roles listed in
wlcmsUserCompare(), there's a warning on the Dashboard when viewing in debug mode:
Notice: Undefined index: <Role Name> in /var/www/html/wp-content/plugins/white-label-cms/wlcms-plugin.php on line 129
Of course it's non-trivial to rank roles, so a custom filter would be helpful for those of us that would use the functionality.
Beyond that, checking the element with
isset() would be best.
$needsToBe = isset( $roles[$needsToBe] ) ? $roles[$needsToBe] : 0; $current = isset( $roles[$current] ) ? $roles[$current] : 0;