WordPress.org

Make WordPress Core

Changeset 47296


Ignore:
Timestamp:
02/17/2020 03:22:43 AM (5 months ago)
Author:
SergeyBiryukov
Message:

REST API: Restore wp-admin/includes/image.php requirement in WP_REST_Attachments_Controller::create_item().

Although the file is already included via the ::insert_attachment() method, this addresses an inconsistency and corrects a misleading comment.

It also reduces the possibility of a future error in case ::insert_attachment() is no longer called earlier in ::create_item() at some point.

Follow-up to [43850] and [44206].

Props luisrivera.
Fixes #49449.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r47295 r47296  
    186186        }
    187187
    188         // Include media functions to get access to wp_generate_attachment_metadata().
     188        // Include media and image functions to get access to wp_generate_attachment_metadata().
    189189        require_once ABSPATH . 'wp-admin/includes/media.php';
     190        require_once ABSPATH . 'wp-admin/includes/image.php';
    190191
    191192        // Post-process the upload (create image sub-sizes, make PDF thumbnalis, etc.) and insert attachment meta.
Note: See TracChangeset for help on using the changeset viewer.