feat(user-center): redesign sidebar and wallet tips

This commit is contained in:
kate522 committed 2026-07-28 13:41:00 +08:00
1 parent 82e71d1bf9
commit a7f3caec59
24 files changed
+895 -528

No files matched your search

@@ -1,47 +1,35 @@
<?php
/**
* User center sidebar: creator and community shortcuts.
* User center sidebar: creation and promotion center pair.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$creator_links = array_filter([
[
'url' => (string) ($new_post_url ?? ''),
'icon' => 'pen',
'label' => __('发布文章', 'aksrt'),
],
[
'url' => (string) ($new_product_url ?? ''),
'icon' => 'store',
'label' => __('发布商品', 'aksrt'),
],
[
'url' => (string) ($forum_compose_url ?? ''),
'icon' => 'comments',
'label' => __('论坛发帖', 'aksrt'),
],
[
'url' => (string) ($revenue_url ?? ''),
'icon' => 'chart-line',
'label' => __('创作收益', 'aksrt'),
],
], static fn(array $item): bool => $item['url'] !== '');
$creation_url = (string) ($new_post_url ?? '');
if ($creation_url === '') {
$creation_url = isset($dashboard_tabs['posts']) ? aksrt_get_user_center_tab_url('posts') : '';
}
$promotion_url = (string) ($revenue_url ?? '');
if (!$creator_links) {
return;
if ($creation_url === '' && $promotion_url === '') {
return;
}
?>
<div class="uc-sidebar__section">
<div class="uc-sidebar__title"><?php esc_html_e('创作服务', 'aksrt'); ?></div>
<div class="uc-sidebar__buttons">
<?php foreach ($creator_links as $item) : ?>
<a class="uc-sidebar__btn" href="<?php echo esc_url($item['url']); ?>">
<i class="fas fa-<?php echo esc_attr($item['icon']); ?>" aria-hidden="true"></i>
<span><?php echo esc_html($item['label']); ?></span>
</a>
<?php endforeach; ?>
</div>
<div class="uc-sidebar__pair uc-sidebar__pair--centers">
<?php if ($creation_url !== '') : ?>
<a class="uc-center-card uc-center-card--creation" href="<?php echo esc_url($creation_url); ?>">
<span class="uc-center-card__icon"><i class="fas fa-feather-alt" aria-hidden="true"></i></span>
<span><strong><?php esc_html_e('创作中心', 'aksrt'); ?></strong><small><?php esc_html_e('发布与管理内容', 'aksrt'); ?></small></span>
<i class="fas fa-angle-right" aria-hidden="true"></i>
</a>
<?php endif; ?>
<?php if ($promotion_url !== '') : ?>
<a class="uc-center-card uc-center-card--promotion" href="<?php echo esc_url($promotion_url); ?>">
<span class="uc-center-card__icon"><i class="fas fa-bullhorn" aria-hidden="true"></i></span>
<span><strong><?php esc_html_e('推广中心', 'aksrt'); ?></strong><small><?php esc_html_e('返佣与收益', 'aksrt'); ?></small></span>
<i class="fas fa-angle-right" aria-hidden="true"></i>
</a>
<?php endif; ?>
</div>