Changeset 49172 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
- Timestamp:
- 10/16/2020 03:32:11 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r49108 r49172 192 192 do_action( 'rest_after_insert_attachment', $attachment, $request, true ); 193 193 194 wp_after_insert_post( $attachment, false ); 195 194 196 if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { 195 197 // Set a custom header with the attachment_id. … … 271 273 272 274 // $post_parent is inherited from $attachment['post_parent']. 273 $id = wp_insert_attachment( wp_slash( (array) $attachment ), $file, 0, true );275 $id = wp_insert_attachment( wp_slash( (array) $attachment ), $file, 0, true, false ); 274 276 275 277 if ( is_wp_error( $id ) ) { … … 345 347 /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php */ 346 348 do_action( 'rest_after_insert_attachment', $attachment, $request, false ); 349 350 wp_after_insert_post( $attachment, true ); 347 351 348 352 $response = $this->prepare_item_for_response( $attachment, $request );
Note: See TracChangeset
for help on using the changeset viewer.