From c39e63245f56e983e493b9b34276e4067efed044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Droz?= Date: Thu, 1 Aug 2024 17:26:53 -0300 Subject: [PATCH] don't hardcode attachment post-type This code-path can't be override (contrary to checks done by the Timmy\Image constructor. Be it for usage with custom-post-type or subclassing attachment, or any other plugin edge-case, this check would be better left to a place it can be skipped/made optional. --- lib/Timmy.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/Timmy.php b/lib/Timmy.php index 34f4c7a..267605e 100644 --- a/lib/Timmy.php +++ b/lib/Timmy.php @@ -136,10 +136,6 @@ public static function get_image( $attachment, $size ) { $attachment = (int) $attachment['ID']; } - if ( 'attachment' !== get_post_type( $attachment ) ) { - return null; - } - $class = apply_filters( 'timmy/image/class', Image::class ); $size_array = $size;