[wp-trac] [WordPress Trac] #29009: There should be a capability for "publish private posts"
WordPress Trac
noreply at wordpress.org
Tue Dec 23 01:38:26 UTC 2014
#29009: There should be a capability for "publish private posts"
-----------------------------+-----------------------------
Reporter: t.schwarz | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone:
Component: Role/Capability | Version: 3.9.1
Severity: normal | Resolution:
Keywords: dev-feedback | Focuses: administration
-----------------------------+-----------------------------
Changes (by jfarthing84):
* keywords: => dev-feedback
* status: closed => reopened
* resolution: wontfix =>
Comment:
+1. The {{{map_meta_cap}}} solution is not really feasible, considering
the context in which the status is forcibly changed. Have a look at
{{{_wp_translate_postdata()}}}:
{{{
if ( isset( $post_data['post_status'] ) && 'private' ==
$post_data['post_status'] && ! current_user_can(
$ptype->cap->publish_posts ) ) {
$post_data['post_status'] = $previous_status ? $previous_status :
'pending';
}
}}}
Of course, {{{_wp_translate_postdata()}}} simply works with the global
{{{$_POST}}} data. So, it would take some pretty silly logic (inside a
{{{map_meta_cap}}} filter callback) to determine the current page, the
current action and the desired post status.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29009#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list