mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user