pre_upload_error WordPress Filter Hook
The pre_upload_error hook is called before an uploaded file is processed by WordPress. It can be used to prevent certain files from being uploaded, or to modify the way uploaded files are processed.
apply_filters( 'pre_upload_error', bool $error ) #
Filters whether to preempt the XML-RPC media upload.
Description
Returning a truthy value will effectively short-circuit the media upload, returning that value as a 500 error instead.
Parameters
- $error
(bool)Whether to pre-empt the media upload. Default false.
Source
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |