Skip to content

Commit

Permalink
Merge pull request #1378 from dhananjaykuber/fix/1375-prevent-jpeg-ou…
Browse files Browse the repository at this point in the history
…tput-when-disabled

WebP Uploads: Prevent picture element when JPEG output is disabled
  • Loading branch information
adamsilverstein authored Jul 22, 2024
2 parents f70b0a2 + cd8c7d1 commit 58447e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/webp-uploads/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function webp_uploads_sanitize_image_format( string $image_format ): string {
* @return bool True if the option is enabled, false otherwise.
*/
function webp_uploads_is_picture_element_enabled(): bool {
return (bool) get_option( 'webp_uploads_use_picture_element', false );
return webp_uploads_is_jpeg_fallback_enabled() && (bool) get_option( 'webp_uploads_use_picture_element', false );
}

/**
Expand Down

0 comments on commit 58447e0

Please sign in to comment.