Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKau committed Sep 20, 2024
2 parents bc72811 + 492c2a7 commit 3386be9
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 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,13 +32,23 @@ 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
// Get image
$image_urls = air_helper_get_image_lazyload_sizes( $image_id, $args['sizes'] );

// Check if we have image
Expand Down

0 comments on commit 3386be9

Please sign in to comment.