Skip to content

Commit

Permalink
Merge pull request #237 from humanmade/hotfix-function-not-available
Browse files Browse the repository at this point in the history
Hotfix function not available
  • Loading branch information
mattheu authored Feb 7, 2025
2 parents c3b1e20 + a9a556d commit 1e939b9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

## v0.5.9

- Bug: Fix wp_img_tag_add_auto_sizes not available before WP 6.7

## v0.5.8

- Bug: Fix adding image optimization attributes to images
Expand Down
6 changes: 5 additions & 1 deletion inc/cropper/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,11 @@ function content_img_tag( string $filtered_image, string $context, int $attachme
// These rely on width/heights being set correctly which is not set at the point core calls them.
// See wp_img_tag_add_auto_sizes
$filtered_image = wp_img_tag_add_loading_optimization_attrs( $filtered_image, $context );
$filtered_image = wp_img_tag_add_auto_sizes( $filtered_image );

// Availabile in WP 6.7 only.
if ( function_exists( 'wp_img_tag_add_auto_sizes' ) ) {
$filtered_image = wp_img_tag_add_auto_sizes( $filtered_image );
}

return $filtered_image;
}
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Description: Advanced media tools that take advantage of Rekognition and Tachyon.
* Author: Human Made Limited
* License: GPL-3.0
* Version: 0.5.8
* Version: 0.5.9
*/

namespace HM\Media;
Expand Down

0 comments on commit 1e939b9

Please sign in to comment.