[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 Apr 17 16:06:01 UTC 2018


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

Comment (by juiceboxint):

 Replying to [comment:52 danielbachhuber]:
 > Furthermore, `edit_posts` would only be applicable to post types that
 use it. Another post type could use something like `edit_products`. We'd
 be back at square one: users not appearing in the dropdown.

 Right, it would have to take into account the equivalent capability for
 whatever post type is being viewed, as set in the CPT definition function.
 So some CPTs may just map straight back to `edit_posts` for simplicity's
 sake, while another might create their own `edit_staff_member` capability
 to keep things separate.

 At the end of the day, though, I don't know of a situation where a user
 who can view & edit ''this post'' (or page, or CPT) would not be allowed
 to be selected as an author. Is that correct? So I wonder if it is over-
 complicating the matter to look for any solution beyond "pull a list of
 people who are able to edit this particular post, using the same
 parameters that are used to determine whether they can view this
 particular edit screen in the first place".

 So then it wouldn't really matter if capabilities can be modified at
 runtime, because the result has already been fully calculated by the very
 fact that this page is being viewed right now, so by the time the author
 box is rendered, we at least have a starting point - which can then be
 modified as needed by the existing filters.

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


More information about the wp-trac mailing list