Zibll 主线收口:减层统一 single 与首页主内容流
把 single.php 收成薄壳,文章组合迁入 aksrt-single; 首页去掉 legacy module 桥接与多余 stream 文案层, 保留 renderer / tab-panel / sort 协议并形成页面自有 aside。
This commit is contained in:
1 parent
256c23b226
commit
29bd9bd152
5 files changed
+825
-523
No files matched your search
@@ -1,30 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Shared author info bar for single post/resource content.
|
||||
* Shared author info bar for single post content.
|
||||
*
|
||||
* Prefer explicit $args (third arg of get_template_part).
|
||||
* Ambient query-var fallback is kept only for residual callers.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$extra_class = (string) get_query_var('aksrt_author_bar_class', '');
|
||||
$show_actions = (bool) get_query_var('aksrt_author_bar_actions', false);
|
||||
$show_bio = (bool) get_query_var('aksrt_author_bar_bio', false);
|
||||
$meta_items = get_query_var('aksrt_author_bar_meta_items', []);
|
||||
$args = is_array($args ?? null) ? $args : [];
|
||||
|
||||
$extra_class = (string) ($args['extra_class'] ?? get_query_var('aksrt_author_bar_class', ''));
|
||||
$show_actions = array_key_exists('show_actions', $args)
|
||||
? (bool) $args['show_actions']
|
||||
: (bool) get_query_var('aksrt_author_bar_actions', false);
|
||||
$show_bio = array_key_exists('show_bio', $args)
|
||||
? (bool) $args['show_bio']
|
||||
: (bool) get_query_var('aksrt_author_bar_bio', false);
|
||||
$meta_items = array_key_exists('meta_items', $args)
|
||||
? $args['meta_items']
|
||||
: get_query_var('aksrt_author_bar_meta_items', []);
|
||||
$meta_items = is_array($meta_items) ? array_values(array_filter($meta_items, static function ($meta_item) {
|
||||
if (is_array($meta_item)) {
|
||||
return !empty($meta_item['text']);
|
||||
}
|
||||
|
||||
return is_string($meta_item) && $meta_item !== '';
|
||||
})) : [];
|
||||
|
||||
$updated_text = sprintf(
|
||||
esc_html__('%s前更新', 'aksrt'),
|
||||
esc_html(human_time_diff(get_the_modified_time('U'), current_time('timestamp')))
|
||||
esc_html(human_time_diff((int) get_the_modified_time('U'), current_time('timestamp')))
|
||||
);
|
||||
$author_bio = trim((string) get_the_author_meta('description'));
|
||||
$author_id = (int) get_the_author_meta('ID');
|
||||
|
||||
$classes = trim('article-avatar ' . $extra_class . ($show_actions ? ' article-avatar--with-actions' : ''));
|
||||
?>
|
||||
|
||||
@@ -36,7 +46,7 @@ $classes = trim('article-avatar ' . $extra_class . ($show_actions ? ' article-av
|
||||
<div class="article-avatar__body">
|
||||
<a href="<?php echo esc_url(get_author_posts_url($author_id)); ?>" class="article-avatar__name"><?php the_author(); ?></a>
|
||||
<div class="comt-meta muted-2-color">
|
||||
<item class="post-time"><i class="far fa-clock" aria-hidden="true"></i> <?php echo $updated_text; ?></item>
|
||||
<item class="post-time"><i class="far fa-clock" aria-hidden="true"></i> <?php echo $updated_text; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></item>
|
||||
<?php foreach ($meta_items as $meta_item) : ?>
|
||||
<?php
|
||||
$meta_text = is_array($meta_item) ? (string) ($meta_item['text'] ?? '') : (string) $meta_item;
|
||||
@@ -58,7 +68,7 @@ $classes = trim('article-avatar ' . $extra_class . ($show_actions ? ' article-av
|
||||
<i class="line-form-line" aria-hidden="true"></i>
|
||||
<div class="single-metabox abs-right" aria-label="<?php esc_attr_e('作者操作', 'aksrt'); ?>">
|
||||
<?php if (is_user_logged_in() && $author_id !== get_current_user_id()) : ?>
|
||||
<button type="button" class="author-action-btn author-action-btn--follow" data-aksrt-follow="<?php echo $author_id; ?>">
|
||||
<button type="button" class="author-action-btn author-action-btn--follow" data-aksrt-follow="<?php echo (int) $author_id; ?>">
|
||||
<i class="far fa-heart" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('关注', 'aksrt'); ?></span>
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user