Skip to content

Commit 30b2d0c

Browse files
chore: check for object type
1 parent ae45ab8 commit 30b2d0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

inc/rest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,11 @@ public static function can_move_image( WP_REST_Request $request ) {
11721172
}
11731173

11741174
$id = $request->get_param( 'id' );
1175-
if ( ! current_user_can( 'edit_post', $id ) ) {
1175+
1176+
if (
1177+
get_post_type( $id ) !== 'attachment' ||
1178+
! current_user_can( 'edit_post', $id )
1179+
) {
11761180
return false;
11771181
}
11781182

0 commit comments

Comments
 (0)