Skip to content

Commit

Permalink
Fix fatal error when "admin_post_thumbnail_html" filter is applied wi…
Browse files Browse the repository at this point in the history
…th null "$thumbnail_id" param
  • Loading branch information
kmgalanakis committed Apr 25, 2024
1 parent 55772cf commit 67be210
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions safe-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ public function one_pixel_fix( $image, $attachment_id, $size, $icon ) {
/**
* If the featured image is an SVG we wrap it in an SVG class so we can apply our CSS fix.
*
* @param string $content Admin post thumbnail HTML markup.
* @param int $post_id Post ID.
* @param int $thumbnail_id Thumbnail ID.
* @param string $content Admin post thumbnail HTML markup.
* @param int $post_id Post ID.
* @param int|null $thumbnail_id Thumbnail attachment ID, or null if there isn't one.
*
* @return string
*/
public function featured_image_fix( $content, $post_id, $thumbnail_id ) {
public function featured_image_fix( $content, $post_id, $thumbnail_id = null ) {
$mime = get_post_mime_type( $thumbnail_id );

if ( 'image/svg+xml' === $mime ) {
Expand Down

0 comments on commit 67be210

Please sign in to comment.