[wp-trac] [WordPress Trac] #54982: In 5.9 (classic) post editor the author pulldown only lists users with "edit_posts" capability

WordPress Trac noreply at wordpress.org
Thu Feb 3 16:12:27 UTC 2022


#54982: In 5.9 (classic) post editor the author pulldown only lists users with
"edit_posts" capability
--------------------------+---------------------
 Reporter:  joneiseman    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.9.1
Component:  Editor        |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by joneiseman):

 By default WordPress always gave Editors and Authors the "edit_posts"
 capability. I had removed this capability for those roles using the User
 Role Editor plugin (back in 2012). That's why I saw the problem in 5.9.
 Prior to 5.9 it selected the users based on the role and now it's based on
 the edit_posts capability. I can add a filter to work around the problem.


 {{{
 add_filter( 'wp_dropdown_users_args', 'my_dropdown_users_args', 10, 1 );
 function my_dropdown_users_args( $query_args )
 {
     $query_args['capability'] =  [];
     $query_args['roles__in'] = [ "Author", "Contributor", "Editor" ];
     return $query_args;
 }
 }}}

 I think the administrator should be able to assign any user as the author
 even if that user doesn't have the edit_posts capability.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54982#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list