WordPress.org

Forums

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

  1. deltafactory
    Member
    Posted 1 year 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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • White Label CMS
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic