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 f9cf02f344..671afa6f4b 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 @@ -810,6 +810,9 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { return new WP_Error( 'rest_upload_file_too_big', sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ), get_site_option( 'fileupload_maxk', 1500 ) ), array( 'status' => 400 ) ); } + // Include admin function to get access to upload_is_user_over_quota(). + require_once ABSPATH . 'wp-admin/includes/ms.php'; + if ( upload_is_user_over_quota( false ) ) { return new WP_Error( 'rest_upload_user_quota_exceeded', __( 'You have used your space quota. Please delete files before uploading.' ), array( 'status' => 400 ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 7757911d1c..082e0e8fb2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43689'; +$wp_version = '5.0-alpha-43691'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.