Files
wordpress-theme-aksrt/inc/helpers/user-center-renderers/profile-posts.php
T

38 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* User center profile posts part (orchestrator).
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
$can_submit_posts = class_exists('\\AKSRT\\Core\\FrontSubmit')
&& \AKSRT\Core\FrontSubmit::get_instance()->can_submit((int) $user_id);
?>
<div class="widget-card">
<div class="profile-list-header creator-center-header">
<div class="creator-center-heading">
<h2 class="widget-title widget-title--inline"><?php esc_html_e('创作中心', 'aksrt'); ?></h2>
<p class="creator-center-heading__summary">
<?php
/* translators: %d: total post count */
printf(esc_html__('管理你的文章、草稿和审核状态(共 %d 篇)', 'aksrt'), $post_count);
?>
</p>
</div>
<div class="creator-center-actions">
<?php if (!empty($new_post_url) && $can_submit_posts) : ?>
<a class="btn-primary btn-sm" href="<?php echo esc_url($new_post_url); ?>">
<span aria-hidden="true">+</span>
<?php esc_html_e('新建文章', 'aksrt'); ?>
</a>
<?php endif; ?>
<?php require __DIR__ . '/posts-status-filter.php'; ?>
</div>
</div>
<?php require __DIR__ . '/posts-list.php'; ?>
</div>