feat(frontend): replace lazy loading with zibll lazysizes

This commit is contained in:
2026-08-18 01:33:38 +08:00
parent 02571eecd6
commit 435ee1daa7
78 changed files with 1515 additions and 909 deletions
+1 -1
View File
@@ -237,7 +237,7 @@ if (!$messages_base) {
<div class="aksrt-pm__item<?php echo !empty($conv['unread']) ? ' is-unread' : ''; ?>"
data-conv-id="<?php echo esc_attr((string) ($conv['id'] ?? '')); ?>"
data-other-id="<?php echo esc_attr((string) ($conv['other_user_id'] ?? '')); ?>">
<img class="aksrt-pm__avatar" src="<?php echo esc_url((string) ($conv['other_avatar'] ?? '')); ?>" alt=""<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('avatar') : ' loading="lazy"'; ?> />
<img<?php echo aksrt_get_lazy_attr('lazy_private', (string) ($conv['other_avatar'] ?? ''), 'aksrt-pm__avatar', aksrt_get_lazy_thumb('sm')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
<div class="aksrt-pm__info">
<div class="aksrt-pm__name">
<?php echo esc_html((string) ($conv['other_name'] ?? '')); ?>
+1 -2
View File
@@ -35,9 +35,8 @@ if (empty($images)) return;
class="content-gallery__link"
<?php echo $lightbox ? 'data-lightbox="gallery"' : ''; ?>
data-caption="<?php echo esc_attr($caption); ?>">
<img src="<?php echo esc_url($src); ?>"
<img<?php echo aksrt_get_lazy_attr('lazy_posts_content', (string) $src, 'content-gallery__img', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
alt="<?php echo esc_attr($alt); ?>"
class="content-gallery__img"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('content') : ' loading="lazy"'; ?>
width="<?php echo esc_attr($img['width'] ?? 800); ?>"
height="<?php echo esc_attr($img['height'] ?? 600); ?>">
</a>
+31 -174
View File
@@ -1,174 +1,31 @@
<?php␍
/**␍
* Post Card / List Item Template — Unified Wrapper (v4.0)␍
*␍
* This template delegates to the unified shared renderer (aksrt_render_post).␍
* It preserves backward compatibility for callers using get_template_part().␍
*␍
* @package AKSRT␍
* @since 4.0.0␍
*/␍
␍
defined('ABSPATH') || exit;␍
␍
// If the shared renderer is available, delegate entirely␍
if (function_exists('aksrt_render_post')) {␍
$args = isset($args) && is_array($args) ? $args : [];␍
␍
// Resolve layout mode from query var or args␍
$forced_layout = (string) get_query_var('aksrt_post_card_layout', '');␍
$mode = 'card';␍
␍
if (is_string($forced_layout) && in_array($forced_layout, ['card', 'list', 'grid-cms'], true)) {␍
$mode = $forced_layout;␍
} elseif (!empty($args['mode']) && in_array($args['mode'], ['card', 'list', 'grid-cms', 'mini'], true)) {␍
$mode = $args['mode'];␍
} elseif (function_exists('aksrt_get_post_flow') && aksrt_get_post_flow(get_the_ID()) === 'cms') {␍
$mode = 'grid-cms';␍
} elseif (class_exists('\AKSRT\Settings\Settings')) {␍
$archive_layout = \AKSRT\Settings\Settings::get_archive_layout();␍
$mode = in_array($archive_layout, ['card', 'list', 'grid-cms'], true) ? $archive_layout : 'card';␍
}␍
␍
// Resolve scene context␍
$scene = (string) get_query_var('aksrt_post_card_scene', '');␍
$context = ($scene === 'home' || is_front_page() || (is_home() && !is_paged())) ? 'home' : 'archive';␍
␍
$config = array_merge($args, [␍
'mode' => $mode,␍
'context' => $context,␍
]);␍
␍
echo aksrt_render_post($config); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped␍
return;␍
}␍
␍
// ============================================================␍
// Fallback: self-contained rendering when shared renderer unavailable␍
// ============================================================␍
␍
$args = isset($args) && is_array($args) ? $args : [];␍
␍
$lazy_cfg = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_lazyload_config() : ['enabled' => false, 'placeholder_url' => ''];␍
$lazy_on = !empty($lazy_cfg['enabled']);␍
$placeholder_url = !empty($lazy_cfg['placeholder_url']) ? (string) $lazy_cfg['placeholder_url'] : (get_template_directory_uri() . '/assets/img/placeholder.svg');␍
␍
$forced_layout = (string) get_query_var('aksrt_post_card_layout', '');␍
$layout = 'card';␍
if (is_string($forced_layout) && in_array($forced_layout, ['card', 'list', 'masonry', 'grid-cms'], true)) {␍
$layout = $forced_layout;␍
} elseif (function_exists('aksrt_get_post_flow') && aksrt_get_post_flow(get_the_ID()) === 'cms') {␍
$layout = 'grid-cms';␍
} elseif (class_exists('\AKSRT\Settings\Settings')) {␍
$layout = \AKSRT\Settings\Settings::get_archive_layout();␍
}␍
␍
$post_id = get_the_ID();␍
$author_id = get_the_author_meta('ID');␍
$author = get_the_author();␍
$avatar_url = get_avatar_url($author_id, ['size' => 40]);␍
$time_ago = human_time_diff(get_the_time('U'), current_time('timestamp')) . __('前', 'aksrt');␍
$excerpt = wp_trim_words(get_the_excerpt(), 'list' === $layout ? 30 : 20, '...');␍
$tags = get_the_tags() ?: [];␍
$categories = get_the_category() ?: [];␍
$comment_count = (int) get_comments_number();␍
$views = function_exists('aksrt_get_post_views') ? aksrt_get_post_views($post_id) : 0;␍
$is_sticky = is_sticky($post_id);␍
$title_html = isset($args['title_html']) ? (string) $args['title_html'] : get_the_title();␍
$resource_badge = function_exists('aksrt_resource_card_badge_text') ? aksrt_resource_card_badge_text($post_id) : '';␍
␍
$img_url = '';␍
if (has_post_thumbnail()) {␍
$img_url = get_the_post_thumbnail_url($post_id, 'medium_large');␍
} elseif (function_exists('aksrt_get_first_content_image_url')) {␍
$img_url = (string) aksrt_get_first_content_image_url($post_id);␍
}␍
$has_img = !empty($img_url);␍
␍
$scene = (string) get_query_var('aksrt_post_card_scene', '');␍
$is_home_scene = $scene === 'home' || is_front_page() || (is_home() && !is_paged());␍
$category_limit = $is_home_scene ? 1 : 3;␍
$tag_limit = $is_home_scene ? 2 : 3;␍
␍
// Badges HTML␍
ob_start();␍
?>␍
<div class="item-tags scroll-x no-scrollbar">␍
<?php if ($resource_badge !== '') : ?>␍
<a rel="nofollow" href="<?php echo esc_url(get_permalink($post_id) . '#posts-pay'); ?>" class="meta-pay but jb-yellow"><?php echo esc_html($resource_badge); ?></a>␍
<?php endif; ?>␍
<?php foreach (array_slice($categories, 0, $category_limit) as $category) : ?>␍
<a href="<?php echo esc_url(get_category_link($category->term_id)); ?>" class="but"><i class="far fa-folder-open" aria-hidden="true"></i> <?php echo esc_html($category->name); ?></a>␍
<?php endforeach; ?>␍
<?php foreach (array_slice($tags, 0, $tag_limit) as $tag) : ?>␍
<a href="<?php echo esc_url(get_tag_link($tag->term_id)); ?>" class="but"># <?php echo esc_html($tag->name); ?></a>␍
<?php endforeach; ?>␍
</div>␍
<?php␍
$badges_html = trim((string) ob_get_clean());␍
␍
// Meta HTML␍
ob_start();␍
?>␍
<div class="item-meta muted-2-color flex jsb ac">␍
<item class="meta-author flex ac">␍
<img src="<?php echo esc_url($avatar_url); ?>" alt="" class="avatar-mini" width="20" height="20" loading="lazy">␍
<name class="meta-name"><?php echo esc_html($author); ?></name>␍
<item class="meta-time"><?php echo esc_html($time_ago); ?></item>␍
</item>␍
<div class="meta-right">␍
<item class="meta-view"><i class="fas fa-eye" aria-hidden="true"></i> <?php echo esc_html(function_exists('aksrt_format_number') ? aksrt_format_number($views) : (string) $views); ?></item>␍
<item class="meta-view"><i class="fas fa-comment" aria-hidden="true"></i> <?php echo esc_html((string) $comment_count); ?></item>␍
</div>␍
</div>␍
<?php␍
$meta_html = trim((string) ob_get_clean());␍
␍
if ('list' === $layout) : ?>␍
<article <?php post_class('posts-item list ajax-item'); ?>>␍
<div class="item-thumbnail">␍
<a href="<?php the_permalink(); ?>">␍
<?php if ($has_img && $lazy_on) : ?>␍
<span class="aksrt-skeleton"></span>␍
<img class="fit-cover aksrt-lazy" data-src="<?php echo esc_url($img_url); ?>" src="<?php echo esc_url($placeholder_url); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">␍
<?php elseif ($has_img) : ?>␍
<img class="fit-cover" src="<?php echo esc_url($img_url); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">␍
<?php else : ?>␍
<img class="fit-cover" src="<?php echo esc_url($placeholder_url); ?>" alt="">␍
<?php endif; ?>␍
</a>␍
<?php if ($is_sticky) : ?>␍
<span class="img-badge left badge-sticky"><?php esc_html_e('置顶', 'aksrt'); ?></span>␍
<?php endif; ?>␍
</div>␍
<div class="item-body">␍
<h2 class="item-heading"><a href="<?php the_permalink(); ?>"><?php echo wp_kses_post($title_html); ?></a></h2>␍
<p class="item-excerpt"><?php echo wp_kses_post(esc_html($excerpt)); ?></p>␍
<?php echo $badges_html; ?>␍
<?php echo $meta_html; ?>␍
</div>␍
</article>␍
<?php else : ?>␍
<article <?php post_class('posts-item card ajax-item' . ($is_home_scene ? ' posts-item--home' : '')); ?>>␍
<div class="item-thumbnail">␍
<a href="<?php the_permalink(); ?>">␍
<?php if ($has_img && $lazy_on) : ?>␍
<span class="aksrt-skeleton"></span>␍
<img class="fit-cover aksrt-lazy" data-src="<?php echo esc_url($img_url); ?>" src="<?php echo esc_url($placeholder_url); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">␍
<?php elseif ($has_img) : ?>␍
<img class="fit-cover" src="<?php echo esc_url($img_url); ?>" alt="<?php echo esc_attr(get_the_title()); ?>">␍
<?php else : ?>␍
<img class="fit-cover" src="<?php echo esc_url($placeholder_url); ?>" alt="">␍
<?php endif; ?>␍
</a>␍
<?php if ($is_sticky) : ?>␍
<span class="img-badge left badge-sticky"><?php esc_html_e('置顶', 'aksrt'); ?></span>␍
<?php endif; ?>␍
</div>␍
<div class="item-body">␍
<h2 class="item-heading"><a href="<?php the_permalink(); ?>"><?php echo wp_kses_post($title_html); ?></a></h2>␍
<?php echo $badges_html; ?>␍
<?php echo $meta_html; ?>␍
</div>␍
</article>␍
<?php endif; ?>␍
<?php
/**
* Post card wrapper for the unified renderer.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$args = isset($args) && is_array($args) ? $args : [];
$forced_layout = (string) get_query_var('aksrt_post_card_layout', '');
$mode = 'card';
if (in_array($forced_layout, ['card', 'list', 'grid-cms'], true)) {
$mode = $forced_layout;
} elseif (!empty($args['mode']) && in_array($args['mode'], ['card', 'list', 'grid-cms', 'mini'], true)) {
$mode = (string) $args['mode'];
} elseif (function_exists('aksrt_get_post_flow') && aksrt_get_post_flow(get_the_ID()) === 'cms') {
$mode = 'grid-cms';
} elseif (class_exists('\AKSRT\Settings\Settings')) {
$archive_layout = \AKSRT\Settings\Settings::get_archive_layout();
$mode = in_array($archive_layout, ['card', 'list', 'grid-cms'], true) ? $archive_layout : 'card';
}
$scene = (string) get_query_var('aksrt_post_card_scene', '');
$context = ($scene === 'home' || is_front_page() || (is_home() && !is_paged())) ? 'home' : 'archive';
echo aksrt_render_post(array_merge($args, [
'mode' => $mode,
'context' => $context,
])); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+1 -1
View File
@@ -24,7 +24,7 @@ $excerpt = wp_trim_words(get_the_excerpt(), 30, '...');
<a href="<?php the_permalink(); ?>" class="aksrt-doc-index-card">
<?php if ($thumb) : ?>
<div class="aksrt-doc-index-card__thumb">
<img src="<?php echo esc_url($thumb); ?>" alt=""<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $thumb); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
</div>
<?php else : ?>
<div class="aksrt-doc-index-card__icon">
@@ -70,12 +70,9 @@ $swiper_config = [
<div class="<?php echo esc_attr($slide_classes); ?>"<?php if (!empty($slide['link'])) : ?> data-link="<?php echo esc_url($slide['link']); ?>" data-target="<?php echo esc_attr($link_target); ?>"<?php endif; ?>>
<div class="banner-module__slide-bg">
<?php if (!empty($slide['image'])) : ?>
<img
src="<?php echo esc_url($slide['image']); ?>"
<img<?php echo aksrt_get_lazy_attr('lazy_sider', (string) $slide['image'], 'fit-cover', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
alt="<?php echo esc_attr($slide['title'] ?: get_bloginfo('name')); ?>"
loading="<?php echo 0 === $index ? 'eager' : 'lazy'; ?>"
decoding="async"
class="fit-cover"
>
<?php else : ?>
<div class="banner-module__slide-fallback"></div>
@@ -23,10 +23,7 @@ $show_dates = !isset($cfg['show_dates']) || !empty($cfg['show_dates']);
if (empty($cat_ids)) return;
// 懒加载配置
$lazy_cfg = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_lazyload_config() : ['enabled' => false, 'placeholder_url' => ''];
$lazy_on = !empty($lazy_cfg['enabled']);
$placeholder = $lazy_cfg['placeholder_url'] ?: (get_template_directory_uri() . '/assets/img/placeholder.svg');
$placeholder = aksrt_get_lazy_thumb('lg');
// 组装卡片数据
$cards = [];
@@ -84,12 +81,7 @@ if (empty($cards)) return;
<?php if ($show_views && $card['views'] > 0) : ?>
<span class="cat-card__views"><?php echo esc_html(function_exists('aksrt_format_number') ? aksrt_format_number($card['views']) : number_format_i18n($card['views'])); ?></span>
<?php endif; ?>
<?php if ($lazy_on) : ?>
<span class="aksrt-skeleton"></span>
<img class="cat-card__cover aksrt-lazy" data-src="<?php echo esc_url($card['cover']); ?>" src="<?php echo esc_url($placeholder); ?>" alt="<?php echo esc_attr($card['term']->name); ?>">
<?php else : ?>
<img class="cat-card__cover" src="<?php echo esc_url($card['cover']); ?>" alt="<?php echo esc_attr($card['term']->name); ?>">
<?php endif; ?>
<img<?php echo aksrt_get_lazy_attr('lazy_cover', (string) $card['cover'], 'cat-card__cover', $placeholder); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($card['term']->name); ?>">
</div>
<div class="cat-card__info">
<div>
@@ -32,7 +32,7 @@ if (empty($friend_links)) return;
<li>
<a href="<?php echo esc_url($url); ?>" target="_blank" rel="noopener noreferrer external" class="home-module__friend-card">
<?php if ($logo) : ?>
<img src="<?php echo esc_url($logo); ?>" alt="" class="home-module__friend-avatar"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $logo, 'home-module__friend-avatar'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
<?php endif; ?>
<div class="home-module__friend-meta">
<strong><?php echo esc_html($name); ?></strong>
+13 -11
View File
@@ -377,16 +377,18 @@ if (!empty($hero_banners)) :
}
// Background media (zibll order: video > image).
$s_background = '';
if ($use_video) {
$poster = $image_url !== '' ? ' poster="' . esc_url($image_url) . '"' : '';
$s_background = '<video autoplay loop muted playsinline class="fit-cover radius8" src="' . esc_url($video_url) . '"' . $poster . '></video><div class="absolute"></div>';
} elseif ($image_url !== '') {
$s_background = '<img class="fit-cover radius8' . ($index > 0 ? ' lazyload swiper-lazy' : '') . '"'
. ($index > 0
? ' data-src="' . esc_url($image_url) . '" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'
: ' src="' . esc_url($image_url) . '"')
. ' alt="' . esc_attr($img_alt) . '">';
$s_background = '';
if ($use_video) {
if (aksrt_is_lazy('lazy_sider')) {
$poster = $image_url !== '' ? ' data-poster="' . esc_url($image_url) . '"' : '';
$video_src = ' class="fit-cover radius8 lazyload" src="" data-src="' . esc_url($video_url) . '"';
} else {
$poster = $image_url !== '' ? ' poster="' . esc_url($image_url) . '"' : '';
$video_src = ' class="fit-cover radius8" src="' . esc_url($video_url) . '"';
}
$s_background = '<video autoplay loop muted playsinline' . $video_src . $poster . '></video><div class="absolute"></div>';
} elseif ($image_url !== '') {
$s_background = '<img' . aksrt_get_lazy_attr('lazy_sider', $image_url, 'fit-cover radius8', aksrt_get_lazy_thumb('lg')) . ' alt="' . esc_attr($img_alt) . '">';
} else {
continue;
}
@@ -403,7 +405,7 @@ if (!empty($hero_banners)) :
if ($layer_image === '') {
continue;
}
$layer_img = '<img class="radius8 lazyload swiper-lazy" data-src="' . esc_url($layer_image) . '" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="' . esc_attr($img_alt) . '">';
$layer_img = '<img' . aksrt_get_lazy_attr('lazy_sider', $layer_image, 'radius8', aksrt_get_lazy_thumb('lg')) . ' alt="' . esc_attr($img_alt) . '">';
$layer_parallax = isset($layer['parallax']) ? (int) $layer['parallax'] : 0;
$layer_attr = $layer_parallax ? ' data-swiper-parallax="' . $layer_parallax . '%"' : '';
$layer_class = !empty($layer['free_size']) ? ' slide-layer' : '';
@@ -38,7 +38,7 @@ if (empty($items)) return;
?>
<<?php echo esc_attr($card_tag); ?> class="aksrt-highlight-card"<?php echo $card_attrs; ?>>
<?php if ($item_image !== '') : ?>
<img class="aksrt-highlight-card__image" src="<?php echo esc_url($item_image); ?>" alt=""<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $item_image, 'aksrt-highlight-card__image'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
<?php elseif ($item_icon !== '') : ?>
<div class="aksrt-highlight-card__icon"><i class="<?php echo esc_attr($item_icon); ?>"></i></div>
<?php endif; ?>
+1 -1
View File
@@ -57,7 +57,7 @@ if (empty($categories)) {
<a href="<?php echo esc_url($cat_link); ?>" class="home-module__more-link">
<?php if ($cover) : ?>
<div class="home-module__more-cover">
<img src="<?php echo esc_url($cover); ?>" alt=""<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $cover); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
</div>
<?php else : ?>
<div class="home-module__more-cover home-module__more-cover--placeholder">
@@ -40,7 +40,7 @@ if (empty($items)) return;
?>
<<?php echo esc_attr($tag); ?> class="aksrt-marquee__item"<?php echo $attrs; ?>>
<?php if ($image !== '') : ?>
<img src="<?php echo esc_url($image); ?>" alt="<?php echo esc_attr($name); ?>"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $image); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($name); ?>">
<?php else : ?>
<span><?php echo esc_html($name); ?></span>
<?php endif; ?>
@@ -36,7 +36,7 @@ if (empty($products)) return;
<a href="<?php echo esc_url($p_url ?: '#'); ?>" class="aksrt-product-card">
<?php if ($p_image !== '') : ?>
<div class="aksrt-product-card__image">
<img src="<?php echo esc_url($p_image); ?>" alt="<?php echo esc_attr($p_title); ?>"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $p_image); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($p_title); ?>">
</div>
<?php endif; ?>
<div class="aksrt-product-card__body">
+1 -1
View File
@@ -65,7 +65,7 @@ if (empty($users)) {
?>
<div class="home-module__user-card">
<a href="<?php echo esc_url($profile); ?>" class="home-module__user-link">
<img src="<?php echo esc_url($avatar); ?>" alt="" class="home-module__user-avatar"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_avatar', (string) $avatar, 'home-module__user-avatar', aksrt_get_lazy_thumb('sm')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
<strong class="home-module__user-name"><?php echo esc_html($display); ?></strong>
</a>
<?php if ($bio) : ?>
+1 -1
View File
@@ -185,7 +185,7 @@ if ($is_need_purchase && $user_amount > 0) {
<div class="resource-download-box__body">
<?php if ($has_thumbnail) : ?>
<div class="resource-download-box__thumb-col">
<img class="resource-download-box__thumb" src="<?php echo esc_url($thumbnail); ?>" alt="<?php echo esc_attr(get_the_title()); ?>"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('other') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_other', (string) $thumbnail, 'resource-download-box__thumb'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr(get_the_title()); ?>">
<?php if ($pay_type_badge) : ?>
<div class="resource-download-box__pay-tag"><?php echo $pay_type_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<?php endif; ?>
+1 -1
View File
@@ -54,7 +54,7 @@ extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_ext
<a class="uh-follow__item" href="<?php echo esc_url($profile); ?>">
<span class="uh-follow__avatar">
<?php if ($avatar !== '') : ?>
<img src="<?php echo esc_url($avatar); ?>" alt="" width="48" height="48" loading="lazy">
<img<?php echo aksrt_get_lazy_attr('lazy_avatar', (string) $avatar, 'avatar', aksrt_get_lazy_thumb('sm')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="" width="48" height="48">
<?php else : ?>
<?php echo get_avatar($uid, 48); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
+1 -3
View File
@@ -62,9 +62,7 @@ $pm_url = ($pm_enabled && $messages_url !== '')
<div class="aksrt-author-hero<?php echo $show_cover ? '' : ' aksrt-author-hero--no-cover'; ?>">
<?php if ($show_cover) : ?>
<div class="aksrt-author-hero__cover">
<img class="aksrt-author-hero__cover-img"
src="<?php echo esc_url($bg_url ? $bg_url : get_theme_file_uri('assets/img/person_background.png')); ?>"
alt=""<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('cover') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_cover', (string) ($bg_url ? $bg_url : get_theme_file_uri('assets/img/person_background.png')), 'aksrt-author-hero__cover-img', aksrt_get_lazy_thumb('lg')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="">
<div class="aksrt-author-hero__cover-mask"></div>
<?php if ($follower_count > 0) : ?>
<div class="aksrt-author-hero__cover-metas" aria-label="<?php esc_attr_e('主页数据', 'aksrt'); ?>">
+1 -1
View File
@@ -41,7 +41,7 @@ $show_credits = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Setti
?>
<div class="aksrt-profile-card aksrt-profile-card--shortcode">
<a class="aksrt-profile-card__avatar" href="<?php echo esc_url($home_url); ?>">
<img src="<?php echo esc_url($avatar); ?>" alt="<?php echo esc_attr($user->display_name); ?>" width="64" height="64"<?php echo function_exists('aksrt_lazy_loading') ? aksrt_lazy_loading('avatar') : ' loading="lazy"'; ?>>
<img<?php echo aksrt_get_lazy_attr('lazy_avatar', (string) $avatar, 'avatar', aksrt_get_lazy_thumb('sm')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($user->display_name); ?>" width="64" height="64">
</a>
<div class="aksrt-profile-card__body">
<a class="aksrt-profile-card__name" href="<?php echo esc_url($home_url); ?>"><?php echo esc_html($user->display_name); ?></a>