Changeset 46907 for branches/5.1/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- Timestamp:
- 12/12/2019 06:36:20 PM (5 years ago)
- Location:
- branches/5.1
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.1
- Property svn:mergeinfo changed
/trunk merged: 46893-46896
- Property svn:mergeinfo changed
-
branches/5.1/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r44225 r46907 500 500 } 501 501 502 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) ) {502 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { 503 503 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 504 504 } … … 655 655 } 656 656 657 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) ) {657 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { 658 658 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 659 659 } … … 957 957 */ 958 958 protected function prepare_item_for_database( $request ) { 959 $prepared_post = new stdClass ;959 $prepared_post = new stdClass(); 960 960 961 961 // Post ID.
Note: See TracChangeset
for help on using the changeset viewer.