image_save_pre
image_save_pre
Appears in: wordpress-4.0, wordpress-4.4, wordpress-4.8, wordpress-4.9, wordpress-4.9.4, wordpress-4.9.5, wordpress-4.9.6, wordpress-4.9.7, wordpress-4.9.8, wordpress-5.0, wordpress-5.0.1, wordpress-5.0.2, wordpress-5.0.3, wordpress-5.1, wordpress-5.1.1, wordpress-5.2, wordpress-5.2.1, wordpress-5.2.2, wordpress-5.2.3, wordpress-5.2.4, wordpress-5.3, wordpress-5.3.1, wordpress-5.3.2
Hook Type: filter
Displaying hooks found in version: wordpress-5.3.2apply_filters('image_save_pre') is found 2 times:
- /wp-admin/includes/image-edit.php line 295291292293294295296297298299300301
*
* @param resource
$image
Image resource to be streamed.
* @param int
$attachment_id
The attachment post ID.
*/
$image
= apply_filters(
'image_save_pre'
,
$image
,
$attachment_id
);
switch
(
$mime_type
) {
case
'image/jpeg'
:
header(
'Content-Type: image/jpeg'
);
return
imagejpeg(
$image
, null, 90 );
case
'image/png'
:
- /wp-admin/includes/image-edit.php line 356352353354355356357358359360361362
/* translators: 1: $image, 2: WP_Image_Editor */
_deprecated_argument(
__FUNCTION__
,
'3.5.0'
, sprintf( __(
'%1$s needs to be a %2$s object.'
),
'$image'
,
'WP_Image_Editor'
) );
/** This filter is documented in wp-admin/includes/image-edit.php */
$image
= apply_filters(
'image_save_pre'
,
$image
,
$post_id
);
/**
* Filters whether to skip saving the image file.
*
* Returning a non-null value will short-circuit the save method,
* returning that value instead.