From d372b53ad7368e608e745f3972bbd0790c545e71 Mon Sep 17 00:00:00 2001 From: Rachel Baker Date: Fri, 31 Aug 2018 23:46:23 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@43604 git-svn-id: http://core.svn.wordpress.org/trunk@43433 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../endpoints/class-wp-rest-attachments-controller.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 80f6ac4c25..e317f523aa 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 7af003665a..0d1789885d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43603'; +$wp_version = '5.0-alpha-43604'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.