Check for all required caps before (un)sticking a post.
In cases where a user has the `edit_others_posts` capability but not `publish_posts`, it was possible for that user to unstick a post after editing, since the input field was never made available in that context. Props ericmann, chriscct7. Fixes #24153. Built from https://develop.svn.wordpress.org/trunk@33096 git-svn-id: http://core.svn.wordpress.org/trunk@33067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2096b451c7
commit
c9a29b0123
|
@ -385,7 +385,7 @@ function edit_post( $post_data = null ) {
|
|||
|
||||
wp_set_post_lock( $post_ID );
|
||||
|
||||
if ( current_user_can( $ptype->cap->edit_others_posts ) ) {
|
||||
if ( current_user_can( $ptype->cap->edit_others_posts ) && current_user_can( $ptype->cap->publish_posts ) ) {
|
||||
if ( ! empty( $post_data['sticky'] ) )
|
||||
stick_post( $post_ID );
|
||||
else
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-beta1-33095';
|
||||
$wp_version = '4.3-beta1-33096';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue