diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
index 30ddafc..1d9abfe 100644
|
|
class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { |
170 | 170 | do_action( 'rest_insert_attachment', $attachment, $request, true ); |
171 | 171 | |
172 | 172 | // Include admin functions to get access to wp_generate_attachment_metadata(). |
173 | | require_once ABSPATH . 'wp-admin/includes/admin.php'; |
| 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 | |
… |
… |
class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { |
513 | 513 | // Get the content-type. |
514 | 514 | $type = array_shift( $headers['content_type'] ); |
515 | 515 | |
516 | | /** Include admin functions to get access to wp_tempnam() and wp_handle_sideload() */ |
517 | | require_once ABSPATH . 'wp-admin/includes/admin.php'; |
| 516 | /** Include to get access to wp_tempnam() and wp_handle_sideload() */ |
| 517 | require_once ABSPATH . 'wp-admin/includes/file.php'; |
518 | 518 | |
519 | 519 | // Save the file. |
520 | 520 | $tmpfname = wp_tempnam( $filename ); |
… |
… |
class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { |
703 | 703 | $overrides['action'] = 'wp_handle_mock_upload'; |
704 | 704 | } |
705 | 705 | |
706 | | /** Include admin functions to get access to wp_handle_upload() */ |
707 | | require_once ABSPATH . 'wp-admin/includes/admin.php'; |
| 706 | /** Include 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 | |