[wp-trac] [WordPress Trac] #16841: Manually created user roles not showing in author dropdown regardless of assigned capabilities

WordPress Trac noreply at wordpress.org
Tue Oct 6 20:39:56 UTC 2020


#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:  Future Release
Component:  Role/Capability               |     Version:  3.1
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------

Comment (by jdorner):

 I believe the cause of the issue is the post_author_meta_box() method in
 /wp-admin/includes/meta-boxes.php is calling wp_dropdown_users() with
 'who' => 'authors'.
 Which calls get_users with 'who' => 'authors' which calls WP_User_Query
 with 'who' => 'authors'.

 {{{
 SELECT [[wp_]users.ID,[wp_]users.user_login,[wp_]users.display_name FROM
 [wp_]users INNER JOIN [wp_]usermeta ON ( [wp_]users.ID =
 [wp_]usermeta.user_id ) WHERE 1=1 AND (
   ( [wp_]usermeta.meta_key = '[wp_]user_level' AND
 [wp_]usermeta.meta_value != '0' )
 ) ORDER BY display_name ASC
 }}}

 Why is WP_User_Query still using the deprecated field '[wp_]user_level'?

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


More information about the wp-trac mailing list