用户中心 posts/sidebar/form 渲染器整包拆分并清理标记
This commit is contained in:
1 parent
81d5647205
commit
57ccdb60c4
13 files changed
+450
-380
No files matched your search
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* User center sidebar: stats section.
|
||||
*
|
||||
* Expects extracted $context vars.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
<div class="uc-sidebar__section">
|
||||
<div class="uc-sidebar__title"><?php esc_html_e('数据统计', 'aksrt'); ?></div>
|
||||
<div class="uc-stats">
|
||||
<?php foreach (['posts', 'comments', 'favorites'] as $stat_tab) : ?>
|
||||
<?php if (!isset($dashboard_tabs[$stat_tab])) { continue; } ?>
|
||||
<?php
|
||||
$stat_count = 'posts' === $stat_tab
|
||||
? $post_count
|
||||
: ('comments' === $stat_tab ? $comment_count : $favorite_count);
|
||||
?>
|
||||
<a class="uc-stats__item" href="<?php echo esc_url(add_query_arg('tab', $stat_tab, remove_query_arg('tab'))); ?>">
|
||||
<span class="uc-stats__value"><?php echo esc_html((string) $stat_count); ?></span>
|
||||
<span class="uc-stats__label"><?php echo esc_html($dashboard_tabs[$stat_tab]['label']); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<a class="uc-stats__item" href="<?php echo esc_url($messages_url); ?>">
|
||||
<span class="uc-stats__value"><?php echo esc_html((string) $notification_unread_count); ?></span>
|
||||
<span class="uc-stats__label"><?php esc_html_e('通知', 'aksrt'); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user