Changeset 46918 for branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- Timestamp:
- 12/12/2019 06:56:36 PM (6 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
- Property svn:mergeinfo changed
/trunk merged: 46893,46895
- Property svn:mergeinfo changed
-
branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r43715 r46918 492 492 } 493 493 494 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) ) {494 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { 495 495 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 496 496 } … … 634 634 } 635 635 636 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) ) {636 if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { 637 637 return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); 638 638 } … … 923 923 */ 924 924 protected function prepare_item_for_database( $request ) { 925 $prepared_post = new stdClass ;925 $prepared_post = new stdClass(); 926 926 927 927 // Post ID.
Note: See TracChangeset
for help on using the changeset viewer.