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 22e8fd65e8..a90308101a 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 @@ -173,6 +173,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { do_action( 'rest_insert_attachment', $attachment, $request, true ); // Include admin function to get access to wp_generate_attachment_metadata(). + require_once ABSPATH . 'wp-admin/includes/media.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 92c5ea4666..abadfff698 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-beta2-43849'; +$wp_version = '5.0-beta2-43850'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.