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.
This hook occurs 2 times in this file.
Line | Code |
---|---|
269 |
|
270 | /** |
271 | * Filters the WP_Image_Editor instance for the image to be streamed to the browser. |
272 | * |
273 | * @since 3.5.0 |
274 | * |
275 | * @param WP_Image_Editor $image The image editor instance. |
276 | * @param int $attachment_id The attachment post ID. |
277 | */ |
278 | $image = apply_filters( 'image_editor_save_pre', $image, $attachment_id ); |
279 |
|
280 | if ( is_wp_error( $image->stream( $mime_type ) ) ) { |
281 | return false; |
282 | } |
283 |
|
284 | return true; |
285 | } else { |
286 | /* translators: 1: $image, 2: WP_Image_Editor */ |
287 | _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( __( '%1$s needs to be a %2$s object.' ), '$image', 'WP_Image_Editor' ) ); |
Line | Code |
328 | * @param WP_Image_Editor $image The image editor instance. |
329 | * @param string $mime_type The mime type of the image. |
330 | * @param int $post_id Attachment post ID. |
331 | * @return bool True on success, false on failure. |
332 | */ |
333 | function wp_save_image_file( $filename, $image, $mime_type, $post_id ) { |
334 | if ( $image instanceof WP_Image_Editor ) { |
335 |
|
336 | /** This filter is documented in wp-admin/includes/image-edit.php */ |
337 | $image = apply_filters( 'image_editor_save_pre', $image, $post_id ); |
338 |
|
339 | /** |
340 | * Filters whether to skip saving the image file. |
341 | * |
342 | * Returning a non-null value will short-circuit the save method, |
343 | * returning that value instead. |
344 | * |
345 | * @since 3.5.0 |
346 | * |