48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* User center sidebar: creator and community shortcuts.
|
|
*
|
|
* @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'] !== '');
|
|
|
|
if (!$creator_links) {
|
|
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>
|