current_user_can not working with custom roles
I’ve looked all over for this but it looks like if you’ve created a new role with add_role() and added appropriate capabilities, WordPress is not honoring those capabilities.
when I dump the contents of the current_user array, I can clearly see that the capabilities for a custom role are in the right place but running the function current_user_can() for say, ‘edit_posts’ when that capability exists returns false.
the add_role() function was added to my functions.php file and I can add users to it and see them reflected on the backend. The users can login and read content just fine but when it comes to doing anything more WordPress fails.
Anyone out there dealt with this?
- The topic ‘current_user_can not working with custom roles’ is closed to new replies.