Another bugfix – Roles with spaces/underscores not working
-
Bugfix code in a pull request on the github mirror:
https://github.com/wp-plugins/user-specific-content/pull/2Problem emerged because a user’s roles are recorded using the role’s ‘key’ (ie. all lowercase, underscores instead of spaces, etc.) where the plugin saves roles using the role’s ‘name’ (ie. Capitalised, spaces, etc).
Later comparisons between the two are then sensitive to these differences.Rather than using strategies to make comparison easier (like the strtolower call I removed), it makes more sense to store the same object for roles that WP itself uses. This will make it more robust in handling potential other edge cases.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Another bugfix – Roles with spaces/underscores not working’ is closed to new replies.