Changeset 43529 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
- Timestamp:
- 07/24/2018 04:51:09 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r43462 r43529 137 137 138 138 $attachment = $this->prepare_item_for_database( $request ); 139 $attachment->file = $file;140 139 $attachment->post_mime_type = $type; 141 140 $attachment->guid = $url; … … 145 144 } 146 145 147 $id = wp_insert_post( wp_slash( (array) $attachment ), true ); 146 // $post_parent is inherited from $attachment['post_parent']. 147 $id = wp_insert_attachment( wp_slash( (array) $attachment ), $file, 0, true ); 148 148 149 149 if ( is_wp_error( $id ) ) {
Note: See TracChangeset
for help on using the changeset viewer.