feat(lightbox): 接入全站图片预览
This commit is contained in:
1 parent
0985d0cb0a
commit
ddf7c37556
29 files changed
+1212
-1805
No files matched your search
@@ -1,13 +1,6 @@
|
||||
<?php
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
// window._win runtime bridge (legacy aksrt_win_var)
|
||||
add_action('wp_head', static function () {
|
||||
if (function_exists('aksrt_print_win_var')) {
|
||||
aksrt_print_win_var();
|
||||
}
|
||||
}, 1);
|
||||
|
||||
// 前端隐藏 WordPress Admin Bar
|
||||
// ============================================================
|
||||
|
||||
|
||||
@@ -226,7 +226,8 @@ add_action('init', function () {
|
||||
|
||||
if (empty($slides)) return '';
|
||||
|
||||
return '<div class="aksrt-carousel-block swiper" data-autoplay="' . $autoplay . '" data-delay="' . $delay . '" data-effect="' . $effect . '">'
|
||||
return '<div class="aksrt-carousel-block swiper aksrt-lightbox-trigger" data-aksrt-lightbox="1" data-autoplay="' . $autoplay . '" data-delay="' . $delay . '" data-effect="' . $effect . '">'
|
||||
|
||||
. '<div class="swiper-wrapper">' . $slides . '</div>'
|
||||
. '<div class="swiper-pagination"></div>'
|
||||
. '<div class="swiper-button-prev"></div><div class="swiper-button-next"></div>'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Float button commerce types + runtime window._win bridge (legacy parity).
|
||||
* Float button commerce types.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
@@ -76,61 +76,3 @@ if (!function_exists('aksrt_get_float_pay_vip_html')) :
|
||||
. '</a>';
|
||||
}
|
||||
endif;
|
||||
|
||||
if (!function_exists('aksrt_get_win_runtime_config')) :
|
||||
/**
|
||||
* Build window._win payload (legacy aksrt_win_var subset).
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
function aksrt_get_win_runtime_config(): array {
|
||||
$post_display = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_post_page_settings()
|
||||
: [];
|
||||
$is_mobile = wp_is_mobile();
|
||||
$list_style = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_post_list_style_settings()
|
||||
: [];
|
||||
$signin = function_exists('aksrt_get_login_url')
|
||||
? aksrt_get_login_url(function_exists('aksrt_get_current_url') ? aksrt_get_current_url() : home_url('/'))
|
||||
: wp_login_url();
|
||||
$signup = function_exists('aksrt_get_register_url')
|
||||
? aksrt_get_register_url()
|
||||
: wp_registration_url();
|
||||
|
||||
$views = 0;
|
||||
if (is_singular()) {
|
||||
$views = (int) get_queried_object_id();
|
||||
}
|
||||
|
||||
return [
|
||||
'views' => $views,
|
||||
'www' => home_url('/'),
|
||||
'uri' => get_template_directory_uri(),
|
||||
'ver' => defined('AKSRT_VERSION') ? AKSRT_VERSION : '3.4.0-dev',
|
||||
'imgbox' => !isset($post_display['lightbox']) || !empty($post_display['lightbox']) ? '1' : '',
|
||||
'imgbox_type' => 'group',
|
||||
'imgbox_thumbs' => !isset($post_display['lightbox_thumbs']) || !empty($post_display['lightbox_thumbs']) ? '1' : '',
|
||||
'imgbox_zoom' => !isset($post_display['lightbox_zoom']) || !empty($post_display['lightbox_zoom']) ? '1' : '',
|
||||
'imgbox_full' => !isset($post_display['lightbox_full']) || !empty($post_display['lightbox_full']) ? '1' : '',
|
||||
'imgbox_play' => !empty($post_display['lightbox_play']) ? '1' : '',
|
||||
'imgbox_down' => !empty($post_display['lightbox_down']) ? '1' : '',
|
||||
'sign_type' => class_exists('\AKSRT\Settings\Settings')
|
||||
? (string) (\AKSRT\Settings\Settings::get_all()['user_sign_type'] ?? 'page')
|
||||
: 'page',
|
||||
'signin_url' => $signin,
|
||||
'signup_url' => $signup,
|
||||
'ajax_url' => admin_url('admin-ajax.php'),
|
||||
'ajaxpager' => '1',
|
||||
'ajax_trigger' => (string) ($list_style['ajax_trigger'] ?? '<i class="fa fas fa-angle-right"></i>加载更多'),
|
||||
'ajax_nomore' => (string) ($list_style['ajax_nomore'] ?? __('没有更多内容了', 'aksrt')),
|
||||
'qj_loading' => __('加载中...', 'aksrt'),
|
||||
'is_mobile' => $is_mobile ? '1' : '',
|
||||
'is_logged_in' => is_user_logged_in() ? '1' : '',
|
||||
'user_id' => get_current_user_id(),
|
||||
'rest_url' => esc_url_raw(rest_url('aksrt/v1')),
|
||||
'rest_nonce' => wp_create_nonce('wp_rest'),
|
||||
'nonce' => wp_create_nonce('aksrt_public_nonce'),
|
||||
];
|
||||
}
|
||||
endif;
|
||||
@@ -31,7 +31,7 @@ if (!function_exists('aksrt_single_render_cover')) :
|
||||
?>
|
||||
<div class="single-head-cover">
|
||||
<div class="single-video">
|
||||
<div class="graphic single-cover single-cover--video imgbox-container" style="padding-bottom:<?php echo esc_attr((string) $video_scale); ?>%;">
|
||||
<div class="graphic single-cover single-cover--video" style="padding-bottom:<?php echo esc_attr((string) $video_scale); ?>%;">
|
||||
<div class="aksrt-video single-cover__player" data-aksrt-video data-src="<?php echo esc_url($ctx['cover_url']); ?>"<?php echo $poster !== '' ? ' data-poster="' . esc_url($poster) . '"' : ''; ?> style="position:absolute;inset:0;width:100%;height:100%;"></div>
|
||||
</div>
|
||||
<div class="single-video-footer dplayer-featured">
|
||||
@@ -630,8 +630,9 @@ if (!function_exists('aksrt_single_render_article')) :
|
||||
<?php aksrt_single_render_pay_box($ctx); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($ctx['front_content'] !== '') : ?>
|
||||
<div class="post_front_content theme-box box-body"><?php echo wp_kses_post((string) $ctx['front_content']); ?></div>
|
||||
<?php if ($ctx['front_content'] !== '') : ?>
|
||||
<div class="post_front_content theme-box box-body"<?php echo !empty($settings['lightbox']) ? ' data-aksrt-lightbox="1"' : ''; ?>><?php echo wp_kses_post((string) $ctx['front_content']); ?></div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="theme-box wp-posts-content<?php echo $maxheight > 0 ? ' limit-height' : ''; ?>"
|
||||
|
||||
Reference in new issue
Block a user