Make WordPress Core

Changeset 43691


Ignore:
Timestamp:
10/10/2018 12:36:40 PM (6 years ago)
Author:
danielbachhuber
Message:

REST API: Load missing required file for multisite users

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

Props JakePT, rachelbaker.
Merges [43603] to the 5.0 branch.
Fixes #44864.

File:
1 edited

Legend:

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

    r43681 r43691  
    811811        }
    812812
     813        // Include admin function to get access to upload_is_user_over_quota().
     814        require_once ABSPATH . 'wp-admin/includes/ms.php';
     815
    813816        if ( upload_is_user_over_quota( false ) ) {
    814817            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.