image_editor_save_pre
Filters the WP_Image_Editor instance for the image to be streamed to the browser.
Использование
add_filter( 'image_editor_save_pre', 'wp_kama_image_editor_save_pre_filter', 10, 2 );
/**
* Function for `image_editor_save_pre` filter-hook.
*
* @param WP_Image_Editor $image The image editor instance.
* @param int $attachment_id The attachment post ID.
*
* @return WP_Image_Editor
*/
function wp_kama_image_editor_save_pre_filter( $image, $attachment_id ){
// filter...
return $image;
}
- $image(WP_Image_Editor)
- The image editor instance.
- $attachment_id(int)
- The attachment post ID.
Список изменений
| С версии 3.5.0 | Введена. |
Где вызывается хук
image_editor_save_pre
wp-admin/includes/image-edit.php 355
$image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
wp-admin/includes/image-edit.php 434
$image = apply_filters( 'image_editor_save_pre', $image, $post_id );