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

WordPress Trac noreply at wordpress.org
Thu Jan 22 15:13:12 UTC 2015


#16841: Manually created user roles not showing in author dropdown regardless of
assigned capabilities
-----------------------------+------------------------------
 Reporter:  10sexyapples     |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Role/Capability  |     Version:  3.1
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by juiceboxint):

 Awesome, thanks for tackling it! That would be a good quick fix - any
 built-in role that has an inherent user level > 1 will also have
 `edit_posts`, and authorship has never worked for custom roles prior to
 your patch (without the arcane workaround anyway) so this seems like a
 safe bet to me.

 A more complete solution (maybe step 2?) would be to consider the post
 type context as well, though: if the user has the equivalent `edit_` cap
 for a custom post type, they appear in the authors dropdown for those
 posts. This would allow a user to potentially appear in the authors list
 for a Post but not a Page, or one CPT but not another, etc.

 Again, shouldn't have any BC issues with this because it's never worked
 before your patch makes it into core. The only thing I wonder about is
 whether the quick fix will actually create its own BC issues for the more
 complete fix if that one is done later on. For instance, after your patch,
 a user with `edit_posts` but ''not'' `edit_cpt` could be set as the author
 of a custom post type `cpt`, and later on when the contextual-author fix
 is in core, that user is no longer a valid or selectable author of `cpt`.
 This will be an extremely unlikely scenario, but it's worth thinking about
 whether it's worth skipping straight to the complete fix.

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


More information about the wp-trac mailing list