if ( !
current_user_can( 'upload_files'
) ) { $this->error =
new IXR_Error( 401,
__( 'Sorry, you are not allowed to upload files.'
) );
return $this->error;
} if ( is_multisite() &&
upload_is_user_over_quota( false
) ) { $this->error =
new IXR_Error( 401,
sprintf( /* translators: %s: Allowed space allocation. */
__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.'
),
size_format( get_space_allowed() * MB_IN_BYTES
) ) );
return $this->error;
} /**
* Filters whether to preempt the XML-RPC media upload.
*
* Returning a truthy value will effectively short-circuit the media upload,
* returning that value as a 500 error instead.
*
* @since 2.1.0
*
* @param bool $error Whether to pre-empt the media upload. Default false.
*/