Roles add_cap should call update_user_level_from_caps()
|Reported by:||lgladdy||Owned by:|
I've created a new user role, which didn't appear in the Author drop down list due to #16841. The workaround is to add a level_1 capability to that user, but because wordpress doesn't call update_user_level_from_caps() function when you add_cap, that isn't actually applied to existing users on the role, and you have to move them to a different role and back again if you want to apply the changed user role.
I'd suggest adding a call to update_user_level_from_caps() to add_cap (and remove_cap) to fix this in wp-includes/capabilities.php