return new WP_Error( 'rest_upload_file_too_big',
/* translators: %s: Maximum allowed file size in kilobytes. */
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 multisite admin functions 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
) );
} return true;
} /**
* Gets the request args for the edit item route.
*
* @since 5.5.0
*
* @return array
*/