Skip to content

Commit

Permalink
Merge pull request #203 from 10up/fix/194
Browse files Browse the repository at this point in the history
Fix/194 PHP Deprecated Warning
  • Loading branch information
faisal-alvi authored Jun 14, 2024
2 parents 2b8eea9 + 7d4e730 commit 60749d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion safe-svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ protected function svg_dimensions( $attachment_id ) {
* @param int $attachment_id The image attachment ID.
*/
public function disable_srcset( $image_meta, $size_array, $image_src, $attachment_id ) {
if ( $attachment_id && 'image/svg+xml' === get_post_mime_type( $attachment_id ) ) {
if ( $attachment_id && 'image/svg+xml' === get_post_mime_type( $attachment_id ) && is_array( $image_meta ) ) {
$image_meta['sizes'] = array();
}

Expand Down

0 comments on commit 60749d7

Please sign in to comment.