[wp-trac] [WordPress Trac] #54982: In 5.9 (classic) post editor the author pulldown only lists users with "edit_posts" capability
WordPress Trac
noreply at wordpress.org
Sat Apr 9 00:17:37 UTC 2022
#54982: In 5.9 (classic) post editor the author pulldown only lists users with
"edit_posts" capability
--------------------------+------------------------------
Reporter: joneiseman | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.9
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses:
--------------------------+------------------------------
Comment (by r-a-y):
I can confirm this bug.
The switch to use the `'capability'` argument in `wp_dropdown_users()`
broke the "Author" metabox for one of my custom post type plugins:
https://github.com/WordPress/WordPress/commit/a225165010b5671a86f73401161bd1744f617c47
#diff-175c8967d13579422e4261a53f12b70a90ca4cbdff289c9bbfcf0713770c8bf2L911
Because of the switch to check the CPT's `'edit_posts'` cap, the user
query checks the usermeta table to see if the capability exists:
https://github.com/WordPress/WordPress/commit/a225165010b5671a86f73401161bd1744f617c47
#diff-26773a0cc66b5ba7b3c5108652bb2367424e6a78d4a05d1e35ff6d45701e3c07R458
However, for plugins that dynamically set the CPT's capabilities for the
user with the `'map_meta_cap'` filter and do not manually add the cap to
the usermeta DB table, the query would not return any users.
I have to workaround this by doing a variant of what @joneiseman in
[https://core.trac.wordpress.org/ticket/54982#comment:11 comment 11] for
now.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54982#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list