进行了一些小修复

This commit is contained in:
2026-08-26 21:59:47 +08:00
parent 6eb189ca88
commit 1d073ea293
8 changed files with 15 additions and 57 deletions
-1
View File
@@ -190,7 +190,6 @@ if (($settings['cover_type'] ?? '') === 'video' && (string) ($settings['cover_ur
$settings['show_cover'] = true;
}
$settings['video_episodes'] = $episodes;
$settings['episode_count'] = count($episodes);
$settings['video_poster'] = (string) ($meta['cover_image'] ?? '');
return $settings;
}
+6 -17
View File
@@ -21,10 +21,8 @@ if (!function_exists('aksrt_single_render_cover')) :
$type = (string) $ctx['cover_type'];
$badge = (string) $ctx['status_badge'];
$crumbs = (string) $ctx['breadcrumbs_html'];
$meta_box = (string) ($ctx['meta_box_html'] ?? '');
$img_scale = max(10, min(100, (int) $ctx['img_scale']));
$video_scale = max(20, min(100, (int) $ctx['video_scale']));
$episode = (int) $ctx['episode_count'];
$slides = is_array($ctx['slide_images'] ?? null) ? $ctx['slide_images'] : [];
$poster = (string) ($ctx['video_poster'] ?? '');
$title_html = (string) ($ctx['title_html'] ?? esc_html(get_the_title()));
@@ -37,14 +35,9 @@ if (!function_exists('aksrt_single_render_cover')) :
<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">
<div class="flex jsb at">
<?php if ($crumbs !== '') : ?>
<div class="post-breadcrumbs"><?php echo $crumbs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<?php endif; ?>
<?php if ($meta_box !== '') : ?>
<?php echo str_replace('single-metabox', 'single-metabox mb10 ml10 shrink0', $meta_box); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</div>
<?php if ($crumbs !== '') : ?>
<div class="post-breadcrumbs"><?php echo $crumbs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<?php endif; ?>
<h1 class="article-title">
<?php
$episodes = is_array($ctx['video_episodes'] ?? null) ? $ctx['video_episodes'] : [];
@@ -95,8 +88,7 @@ if (!function_exists('aksrt_single_render_cover')) :
. '<h1 class="article-title title-h-left">' . $title_html . '</h1>'
. ($crumbs !== '' ? $crumbs : '')
. $badge
. '</div>'
. ($meta_box !== '' ? str_replace('single-metabox', 'single-metabox cover-meta abs-right', $meta_box) : '');
. '</div>';
$slider_html = '';
if (function_exists('aksrt_render_slider')) {
$slider_html = aksrt_render_slider([
@@ -142,9 +134,6 @@ if (!function_exists('aksrt_single_render_cover')) :
<?php endif; ?>
<?php echo $badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
<?php if ($meta_box !== '') : ?>
<?php echo str_replace('single-metabox', 'single-metabox cover-meta abs-right', $meta_box); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</div>
</div>
<?php
@@ -153,7 +142,7 @@ endif;
if (!function_exists('aksrt_single_render_box_header')) :
/**
* Title + author bar (when no cover).
* Title + author bar and the canonical article meta row.
*
* @param array<string,mixed> $ctx Single context.
*/
@@ -172,7 +161,7 @@ if (!function_exists('aksrt_single_render_box_header')) :
aksrt_single_render_author_bar([
'show_actions' => true,
'show_time' => empty($settings['hide_time']),
'meta_html' => empty($ctx['show_cover']) ? (string) ($ctx['meta_box_html'] ?? '') : '',
'meta_html' => (string) ($ctx['meta_box_html'] ?? ''),
]);
?>
</div>
+3 -4
View File
@@ -93,14 +93,13 @@ if (!function_exists('aksrt_single_build_context')) :
'post_id' => $post_id,
'settings' => $settings,
'show_cover' => $show_cover,
'cover_url' => (string) ($settings['cover_url'] ?? ''),
'cover_url' => (string) ($settings['cover_url'] ?? ''),
'cover_type' => (string) ($settings['cover_type'] ?? 'none'),
'img_scale' => (int) ($settings['article_image_cover_scale'] ?? 35),
'video_scale' => (int) ($settings['article_video_cover_scale'] ?? 56),
'slide_images' => array_values(array_filter((array) ($settings['slide_images'] ?? []))),
'episode_count' => max(0, (int) ($settings['episode_count'] ?? 0)),
'video_episodes' => is_array($settings['video_episodes'] ?? null) ? array_values($settings['video_episodes']) : [],
'video_poster' => (string) ($settings['video_poster'] ?? ''),
'video_episodes' => is_array($settings['video_episodes'] ?? null) ? array_values($settings['video_episodes']) : [],
'video_poster' => (string) ($settings['video_poster'] ?? ''),
'meta_items' => $meta_items,
'meta_box_html' => $meta_box_html,
'title_html' => function_exists('aksrt_get_single_title_html') ? aksrt_get_single_title_html($post_id) : esc_html(get_the_title($post_id)),