You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The author selection should not present options for users without the edit_posts capability. In default installations, this means excluding the Subscriber role. The users listing endpoint currently supports filtering by role. However, we ought not to hard-code default roles since plugins or themes can add their own custom roles. Therefore, we should seek to enhance the user listing endpoint with one of a few options:
The latter two mimic the behavior of the wp_dropdown_users function used in the current editor to display user options. The who values is an undocumented parameter supported by the WP_User_Query class which filters by user_level != 0.
Noting that while not ideal, it is possible to filter this information client-side: When requesting with ?context=edit query parameter, each user entry in the response will include a capabilities object.
Related: #2100 (specifically #2100 (comment))
The author selection should not present options for users without the
edit_posts
capability. In default installations, this means excluding the Subscriber role. The users listing endpoint currently supports filtering by role. However, we ought not to hard-code default roles since plugins or themes can add their own custom roles. Therefore, we should seek to enhance the user listing endpoint with one of a few options:authors
typeuser_level
authors
is equivalent touser_level != 0
The latter two mimic the behavior of the
wp_dropdown_users
function used in the current editor to display user options. Thewho
values is an undocumented parameter supported by theWP_User_Query
class which filters byuser_level != 0
.References:
post_author_meta_box
wp_dropdown_users
WP_User_Query
The text was updated successfully, but these errors were encountered: