[wp-trac] [WordPress Trac] #48764: RESTI API explicitly checks for publish_posts capability without post ID
WordPress Trac
noreply at wordpress.org
Fri Nov 22 10:42:55 UTC 2019
#48764: RESTI API explicitly checks for publish_posts capability without post ID
--------------------------+------------------------------
Reporter: djzone | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: rest-api
--------------------------+------------------------------
Comment (by SergeyBiryukov):
Hi there, thanks for the patch!
This seems intentional, as the `publish_posts` (plural) capability does
not require a post ID, and there are a lot of other places in core that
don't pass an ID.
Only the [source:tags/5.3/src/wp-
includes/capabilities.php?marks=257-273#L248 publish_post] (singular) meta
capability requires an ID. By default, it falls back to `publish_posts`,
or `edit_others_posts` if the associated post type is no longer available.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48764#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list