- Timestamp:
- 05/23/2020 03:22:53 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
r47547 r47850 170 170 } 171 171 172 $parent_post_type_obj = get_post_type_object( $parent->post_type ); 173 174 if ( ! current_user_can( $parent_post_type_obj->cap->edit_post, $parent->ID ) ) { 172 if ( ! current_user_can( 'edit_post', $parent->ID ) ) { 175 173 return new WP_Error( 176 174 'rest_cannot_read', … … 410 408 $parent_post_type = get_post_type_object( $parent->post_type ); 411 409 412 if ( ! current_user_can( $parent_post_type->cap->delete_post, $parent->ID ) ) {410 if ( ! current_user_can( 'delete_post', $parent->ID ) ) { 413 411 return new WP_Error( 414 412 'rest_cannot_delete', … … 428 426 } 429 427 430 $post_type = get_post_type_object( 'revision' ); 431 432 if ( ! current_user_can( $post_type->cap->delete_post, $revision->ID ) ) { 428 if ( ! current_user_can( 'delete_post', $revision->ID ) ) { 433 429 return new WP_Error( 434 430 'rest_cannot_delete',
Note: See TracChangeset
for help on using the changeset viewer.