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.


Top ↑

Parameters

$error

(bool)Whether to pre-empt the media upload. Default false.


Top ↑

Source

File: wp-includes/class-wp-xmlrpc-server.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More