Skip to content

Commit 62fdd7a

Browse files
committed
Update get_avatar.php
1 parent f914c35 commit 62fdd7a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/get_avatar.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ function get_avatar($id_or_email, $size = 96, $default = '', $alt = '', $args =
8282
'extra_attr' => '',
8383
);
8484

85-
if (wp_lazy_loading_enabled('img', 'get_avatar')) {
86-
$defaults['loading'] = 'lazy';
85+
global $wp_version;
86+
87+
if ($wp_version >= "5.5.0") {
88+
if (wp_lazy_loading_enabled('img', 'get_avatar')) {
89+
$defaults['loading'] = 'lazy';
90+
}
8791
}
8892

8993
if (empty($args)) {

0 commit comments

Comments
 (0)