[wp-trac] [WordPress Trac] #33240: Introduce a capability for previewing posts
WordPress Trac
noreply at wordpress.org
Mon Aug 3 11:36:54 UTC 2015
#33240: Introduce a capability for previewing posts
-------------------------+-------------------------------------------------
Reporter: johnbillion | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: | Version:
Role/Capability | Keywords: needs-patch needs-unit-tests dev-
Severity: normal | feedback
Focuses: |
-------------------------+-------------------------------------------------
In order to preview an unpublished post (ie. draft or pending), a user
needs the `edit_posts` capability for that post type
([https://core.trac.wordpress.org/browser/tags/4.2.3/src/wp-
includes/capabilities.php#L1174 src]).
There is a valid use case where a site requires a user role which has the
capability to preview unpublished posts but not edit them, for example for
editorial review/sign-off, layout review, early access, etc.
You can [http://wordpress.stackexchange.com/a/196209/27051 get around this
by using a combination of the posts_results and the_posts filters], but
this isn't very future-proof because the post results skip a bunch of
logic that occurs between those two filters.
A `preview_post` meta capability and a `preview_posts` primitive
capability could be introduced and implemented wherever the `edit_posts`
capability is used in regard to previewing unpublished posts. By default,
it will simply map to the `edit_posts` capability.
Thoughts?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33240>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list