image_save_pre

image_save_pre

Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-5.3.2

apply_filters('image_save_pre') is found 2 times:

  • /wp-admin/includes/image-edit.php line 295
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    *
     * @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 356
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    /* 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.