Ticket #43757: 43757.2.diff
File 43757.2.diff, 1.5 KB (added by , 7 years ago) |
---|
-
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
169 169 */ 170 170 do_action( 'rest_insert_attachment', $attachment, $request, true ); 171 171 172 // Include admin function sto get access to wp_generate_attachment_metadata().173 require_once ABSPATH . 'wp-admin/includes/ admin.php';172 // Include admin function to get access to wp_generate_attachment_metadata(). 173 require_once ABSPATH . 'wp-admin/includes/image.php'; 174 174 175 175 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); 176 176 … … 514 514 $type = array_shift( $headers['content_type'] ); 515 515 516 516 /** Include admin functions to get access to wp_tempnam() and wp_handle_sideload() */ 517 require_once ABSPATH . 'wp-admin/includes/ admin.php';517 require_once ABSPATH . 'wp-admin/includes/file.php'; 518 518 519 519 // Save the file. 520 520 $tmpfname = wp_tempnam( $filename ); … … 703 703 $overrides['action'] = 'wp_handle_mock_upload'; 704 704 } 705 705 706 /** Include admin function sto get access to wp_handle_upload() */707 require_once ABSPATH . 'wp-admin/includes/ admin.php';706 /** Include admin function to get access to wp_handle_upload() */ 707 require_once ABSPATH . 'wp-admin/includes/file.php'; 708 708 709 709 $file = wp_handle_upload( $files['file'], $overrides ); 710 710