Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_upload_error

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
5278            * Filter whether to preempt the XML-RPC media upload.
5279            *
5280            * Passing a truthy value will effectively short-circuit the media upload,
5281            * returning that value as a 500 error instead.
5282            *
5283            * @since 2.1.0
5284            *
5285            * @param bool $error Whether to pre-empt the media upload. Default false.
5286            */
5287           if ( $upload_err = apply_filters( 'pre_upload_error', false ) ) {
5288                return new IXR_Error( 500, $upload_err );
5289           }
5290
5291           if ( !empty($data['overwrite']) && ($data['overwrite'] == true) ) {
5292                // Get postmeta info on the object.
5293                $old_file = $wpdb->get_row("
5294                     SELECT ID
5295                     FROM {$wpdb->posts}
5296                     WHERE post_title = '{$name}'