Changeset 47261 for trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
- Timestamp:
- 02/11/2020 03:37:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r47122 r47261 142 142 } 143 143 144 $schema = $this->get_item_schema(); 145 144 146 // Extract by name. 145 147 $attachment_id = $insert['attachment_id']; … … 148 150 if ( isset( $request['alt_text'] ) ) { 149 151 update_post_meta( $attachment_id, '_wp_attachment_image_alt', sanitize_text_field( $request['alt_text'] ) ); 152 } 153 154 if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { 155 $meta_update = $this->meta->update_value( $request['meta'], $attachment_id ); 156 157 if ( is_wp_error( $meta_update ) ) { 158 return $meta_update; 159 } 150 160 } 151 161
Note: See TracChangeset
for help on using the changeset viewer.