lib/ImageHelper.php
public static function _delete_generated_if_image( $post_id ) {
		if ( wp_attachment_is_image($post_id) ) {
			$attachment = new Image($post_id);
			if ( $attachment->file_loc ) {
				ImageHelper::delete_generated_files($attachment->file_loc);
			}
		}
	}
public static function _delete_generated_if_image( $post_id ) {
		if ( wp_attachment_is_image($post_id) ) {
			$attachment = new Image($post_id);
			if ( $attachment->file_loc ) {
				ImageHelper::delete_generated_files($attachment->file_loc);
			}
		}
	}
public static function _delete_generated_if_image ( $ post_id ) { if ( wp_attachment_is_image ( $ post_id ) ) { $ attachment = new Image ( $ post_id ) ; if ( $ attachment -> file_loc ) { ImageHelper :: delete_generated_files ( $ attachment -> file_loc ) ; } } }
Checks if attachment is an image before deleting generated files

@param  int  $post_id   an attachment post id
Checks if attachment is an image before deleting generated files