REST API: Load missing required file for multisite users in WP_REST_Attachments_Controller::create_item().

Requires wp-admin/includes/image.php to make `wp_read_image_metadata()` function available. Fixes error introduced in [43589].

Props ocean90, soulseekah.
Fixes #43757.

git-svn-id: https://develop.svn.wordpress.org/trunk@43604 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Rachel Baker 2018-08-31 23:45:17 +00:00
parent 324d440c7a
commit f93c771fc9

View File

@ -122,6 +122,9 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
$type = $file['type'];
$file = $file['file'];
// Include image functions to get access to wp_read_image_metadata().
require_once ABSPATH . 'wp-admin/includes/image.php';
// use image exif/iptc data for title and caption defaults if possible
$image_meta = wp_read_image_metadata( $file );