Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/T-10073' into release-candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilaukkarinen committed Oct 10, 2024
2 parents bf01c65 + 60f209f commit 67d5ef0
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions functions/image-lazyload-native.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
/**
* Image native lazyload.
*
* @Author: Elias Kautto
* @Date: 2022-01-28 12:33:30
* @Last Modified by: Roni Laukkarinen
* @Last Modified time: 2024-03-08 17:49:47
*
* @package air-helper
*/

Expand Down Expand Up @@ -37,11 +32,21 @@ function native_lazyload_tag( $image_id = 0, $args = [] ) {
*/
if ( ! function_exists( 'get_native_lazyload_tag' ) ) {
function get_native_lazyload_tag( $image_id = 0, $args = [] ) {
$args = wp_parse_args( $args, [
'fallback' => false,
'sizes' => [],
'class' => null,
] );
if ( is_string( $args ) ) {
$args = [
'fallback' => false,
'sizes' => [
'big' => $args,
],
'class' => null,
];
} else {
$args = wp_parse_args( $args, [
'fallback' => false,
'sizes' => [],
'class' => null,
] );
}

// Get image
$image_urls = air_helper_get_image_lazyload_sizes( $image_id, $args['sizes'] );
Expand Down

0 comments on commit 67d5ef0

Please sign in to comment.