WordPress.org

Ready to get started?Download WordPress

Forums

White Label CMS
Debug errors when non-standard roles are used (1 post)

  1. deltafactory
    Member
    Posted 3 months ago #

    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;

    Thanks!

    https://wordpress.org/plugins/white-label-cms/

Reply

You must log in to post.

About this Plugin

About this Topic