Skip to content
Permalink
Browse files

REST API: Remove a duplicate `require_once()`.

In `WP_REST_Attachments_Controller::create_item()`, `wp-admin/includes/image.php` was being `require_once()`-ed... twice. The superflous `require_once()` has been quietly removed.

Props david.binda.
See #45420.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44206 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
pento committed Dec 15, 2018
1 parent afc1fcf commit 971928c74d085038ea81d164ec28355268c27048
Showing with 0 additions and 1 deletion.
  1. +0 −1 src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
@@ -174,7 +174,6 @@ public function create_item( $request ) {
// 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 ) );

0 comments on commit 971928c

Please sign in to comment.
You can’t perform that action at this time.