Make WordPress Core

Changeset 43603


Ignore:
Timestamp:
08/31/2018 11:25:39 PM (7 years ago)
Author:
rachelbaker
Message:

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

Requires wp-admin/includes/ms.php to make upload_is_user_over_quota() function available to multisite users uploading files.

Props JakePT, rachelbaker.
Fixes #44864.

File:
1 edited

Legend:

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

    r43589 r43603  
    806806        }
    807807
     808        // Include admin function to get access to upload_is_user_over_quota().
     809        require_once ABSPATH . 'wp-admin/includes/ms.php';
     810
    808811        if ( upload_is_user_over_quota( false ) ) {
    809812            return new WP_Error( 'rest_upload_user_quota_exceeded', __( 'You have used your space quota. Please delete files before uploading.' ), array( 'status' => 400 ) );
Note: See TracChangeset for help on using the changeset viewer.