- Timestamp:
- 08/15/2019 10:00:49 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
r45811 r45812 350 350 } 351 351 352 $parent_post_type = get_post_type_object( $parent->post_type ); 353 if ( ! current_user_can( $parent_post_type->cap->delete_post, $parent->ID ) ) { 354 return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete revisions of this post.' ), array( 'status' => rest_authorization_required_code() ) ); 355 } 356 352 357 $revision = $this->get_revision( $request['id'] ); 353 358 if ( is_wp_error( $revision ) ) { … … 384 389 385 390 $post_type = get_post_type_object( 'revision' ); 386 return current_user_can( $post_type->cap->delete_post, $revision->ID ); 391 392 if ( ! current_user_can( $post_type->cap->delete_post, $revision->ID ) ) { 393 return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this revision.' ), array( 'status' => rest_authorization_required_code() ) ); 394 } 395 396 return true; 387 397 } 388 398
Note: See TracChangeset
for help on using the changeset viewer.