[wp-trac] [WordPress Trac] #44888: Users with custom roles not show on post author metabox

WordPress Trac noreply at wordpress.org
Tue Sep 4 10:33:49 UTC 2018


#44888: Users with custom roles not show on post author metabox
--------------------------+-----------------------------
 Reporter:  araucaria     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Users         |    Version:  4.9.8
 Severity:  minor         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I have created a custom user role, which I want to behave in a similar way
 to the built in Author role - that is, an admin should be able to assign
 them as the author of a post, and the user should then be able to edit the
 post.

 However, the custom user doesn't appear on the dropdown in the Author
 metabox, and this is apparently because the role definition does not
 include the deprecated user levels. That metabox is being populated from
 this query:

 {{{
 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
 }}}

 Workaround is to alter the custom user role to set a user level other than
 zero, but as user levels were deprecated in 3.0, I shouldn't have to do
 this. The post_author_meta_box() function is depending on the deprecated
 user levels.

 I found this article which explains the issue quite clearly: [https://www
 .role-editor.com/wordpress-user-levels-deprecated-just-partially/]

 The following (closed) ticket seems to be reporting the same issue:
 [https://core.trac.wordpress.org/ticket/28230]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44888>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list