Skip to content

Commit 8af2fa6

Browse files
Use edit_media_item_permissions_check directly
Remove redundant finalize_item_permissions_check wrapper and use edit_media_item_permissions_check directly for the finalize route, consistent with the sideload route pattern.
1 parent ec12d75 commit 8af2fa6

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function register_routes() {
111111
array(
112112
'methods' => WP_REST_Server::CREATABLE,
113113
'callback' => array( $this, 'finalize_item' ),
114-
'permission_callback' => array( $this, 'finalize_item_permissions_check' ),
114+
'permission_callback' => array( $this, 'edit_media_item_permissions_check' ),
115115
'args' => array(
116116
'id' => array(
117117
'description' => __( 'Unique identifier for the attachment.' ),
@@ -2206,18 +2206,6 @@ private static function filter_wp_unique_filename( $filename, $dir, $number, $at
22062206
return $filename;
22072207
}
22082208

2209-
/**
2210-
* Checks if a given request has access to finalize an attachment.
2211-
*
2212-
* @since 7.0.0
2213-
*
2214-
* @param WP_REST_Request $request Full details about the request.
2215-
* @return true|WP_Error True if the request has access, WP_Error object otherwise.
2216-
*/
2217-
public function finalize_item_permissions_check( WP_REST_Request $request ) {
2218-
return $this->edit_media_item_permissions_check( $request );
2219-
}
2220-
22212209
/**
22222210
* Finalizes an attachment after client-side media processing.
22232211
*

0 commit comments

Comments
 (0)