WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 6481 | * Filters whether to preempt the XML-RPC media upload. |
| 6482 | * |
| 6483 | * Returning a truthy value will effectively short-circuit the media upload, |
| 6484 | * returning that value as a 500 error instead. |
| 6485 | * |
| 6486 | * @since 2.1.0 |
| 6487 | * |
| 6488 | * @param bool $error Whether to pre-empt the media upload. Default false. |
| 6489 | */ |
| 6490 | $upload_err = apply_filters( 'pre_upload_error', false ); |
| 6491 | if ( $upload_err ) { |
| 6492 | return new IXR_Error( 500, $upload_err ); |
| 6493 | } |
| 6494 | |
| 6495 | $upload = wp_upload_bits( $name, null, $bits ); |
| 6496 | if ( ! empty( $upload['error'] ) ) { |
| 6497 | /* translators: 1: File name, 2: Error message. */ |
| 6498 | $error_string = sprintf( __( 'Could not write file %1$s (%2$s).' ), $name, $upload['error'] ); |
| 6499 | return new IXR_Error( 500, $error_string ); |