Changeset 46897
- Timestamp:
- 12/12/2019 06:07:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.3/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r46435 r46897 499 499 } 500 500 501 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) ) {501 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { 502 502 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 503 503 } … … 654 654 } 655 655 656 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) ) {656 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { 657 657 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 658 658 } … … 956 956 */ 957 957 protected function prepare_item_for_database( $request ) { 958 $prepared_post = new stdClass ;958 $prepared_post = new stdClass(); 959 959 960 960 // Post ID.
Note: See TracChangeset
for help on using the changeset viewer.