[wp-trac] [WordPress Trac] #16841: Manually created user roles not showing in author dropdown regardless of assigned capabilities
WordPress Trac
noreply at wordpress.org
Wed Jan 9 10:35:20 UTC 2019
#16841: Manually created user roles not showing in author dropdown regardless of
assigned capabilities
------------------------------------------+-------------------------
Reporter: 10sexyapples | Owner: swissspidy
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.1
Component: Role/Capability | Version: 3.1
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses:
------------------------------------------+-------------------------
Comment (by Mte90):
To fix in your instance you have to run this piece of code and use the
user role that you want.
After reading on Slack the problem is that usually usuers created manually
(instead of registration screen) doesn't have this user_level configured.
Anyway in case your issue is different you can fix it running this code
but you have to do it everytime until there is a fix for this problem.
Also this problem happen in REST API so this fix the problem also in
Gutenberg.
{{{
$blogusers = get_users( 'role=instructor' );
foreach ( $blogusers as $user ) {
$user->add_cap('level_1');
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/16841#comment:60>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list