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.



git-svn-id: https://develop.svn.wordpress.org/trunk@33096 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Konstantin Obenland
2015-07-06 22:40:59 +00:00
parent 53021ef6fe
commit 2cafc0d787
2 changed files with 100 additions and 1 deletions
+1 -1
View File
@@ -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