Zibll 主线收口:统一 single 并清退 compat 资源路径

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-09 20:30:49 +08:00
co-authored by Claude
parent 0a6f97af21
commit 09f1eec909
26 changed files with 158 additions and 1325 deletions
+21 -7
View File
@@ -91,15 +91,20 @@ while (have_posts()) :
$post_toc_drawer = '';
$post_share_dropdown = '';
$post_reward_modal = '';
$post_sidebar_prepend = '';
$post_episode_count = max(0, (int) get_post_meta($post_id, '_aksrt_featured_video_episode', true));
$post_slide_images = array_values(array_filter((array) ($single_settings['slide_images'] ?? [])));
$author_card_html = '';
$is_resource_compat_post = function_exists('aksrt_is_resource_post') && aksrt_is_resource_post($post_id);
$has_download_capability = function_exists('aksrt_is_downloadable_content') && aksrt_is_downloadable_content($post_id);
$paid_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_paid_content_settings() : [];
$paid_display_settings = is_array($paid_settings['display'] ?? null) ? $paid_settings['display'] : [];
$paid_box_position = (string) ($paid_display_settings['box_position'] ?? 'top');
if (!in_array($paid_box_position, ['box_top', 'top', 'bottom', 'box_bottom'], true)) {
if ($paid_box_position === 'box_top') {
$paid_box_position = 'top';
} elseif ($paid_box_position === 'box_bottom') {
$paid_box_position = 'bottom';
}
if (!in_array($paid_box_position, ['top', 'bottom'], true)) {
$paid_box_position = 'top';
}
if (class_exists('AKSRT_Docs_Presenter')) {
@@ -298,8 +303,8 @@ while (have_posts()) :
<?php do_action('aksrt_single_content_before', $post); ?>
<?php if ($has_download_capability && in_array($paid_box_position, ['box_top', 'top'], true)) : ?>
<div class="aksrt-single-download-box aksrt-single-download-box--before<?php echo $is_resource_compat_post ? ' is-legacy-resource' : ''; ?>">
<?php if ($has_download_capability && $paid_box_position === 'top') : ?>
<div class="aksrt-single-download-box aksrt-single-download-box--before">
<?php get_template_part('templates/parts/resource-download-box'); ?>
</div>
<?php endif; ?>
@@ -331,8 +336,8 @@ while (have_posts()) :
<div class="post_after_content theme-box box-body"><?php echo wp_kses_post($post_after_content); ?></div>
<?php endif; ?>
<?php if ($has_download_capability && in_array($paid_box_position, ['bottom', 'box_bottom'], true)) : ?>
<div class="aksrt-single-download-box aksrt-single-download-box--after<?php echo $is_resource_compat_post ? ' is-legacy-resource' : ''; ?>">
<?php if ($has_download_capability && $paid_box_position === 'bottom') : ?>
<div class="aksrt-single-download-box aksrt-single-download-box--after">
<?php get_template_part('templates/parts/resource-download-box'); ?>
</div>
<?php endif; ?>
@@ -471,7 +476,16 @@ while (have_posts()) :
<?php if ($show_sidebar) : ?>
<?php
set_query_var('aksrt_sidebar_prepend_html', $show_toc ? $post_toc_widget : '');
$post_sidebar_prepend = '';
if ($has_download_capability) {
ob_start();
get_template_part('templates/parts/resource-meta-box');
$post_sidebar_prepend .= (string) ob_get_clean();
}
if ($show_toc && $post_toc_widget !== '') {
$post_sidebar_prepend .= $post_toc_widget;
}
set_query_var('aksrt_sidebar_prepend_html', $post_sidebar_prepend);
get_sidebar();
set_query_var('aksrt_sidebar_prepend_html', '');
?>