feat(user-center): upgrade posts panel to creator center

This commit is contained in:
2026-08-06 16:24:59 +08:00
parent 7891ce7096
commit 2f9384f368
7 changed files with 123 additions and 36 deletions
+18 -11
View File
@@ -21,20 +21,21 @@ if (!is_array($action)) {
$action_type = isset($action['type']) ? (string) $action['type'] : '';
$action_url = isset($action['url']) ? (string) $action['url'] : '';
$action_label = isset($action['label']) ? (string) $action['label'] : '';
$delete_action = isset($args['delete_action']) && is_array($args['delete_action']) ? $args['delete_action'] : [];
$status_label = isset($args['status']) ? (string) $args['status'] : (string) get_query_var('aksrt_profile_item_status', '');
$post_id = get_the_ID();
$permalink = get_permalink();
$title = get_the_title();
$date_iso = get_the_date('c');
$date_label = get_the_date();
$excerpt = wp_trim_words(get_the_excerpt(), 30, '…');
$comment_count = (int) get_comments_number();
$categories = get_the_category() ?: [];
$tags = get_the_tags() ?: [];
$post_id = get_the_ID();
$permalink = get_permalink();
$title = get_the_title();
$date_iso = get_the_date('c');
$date_label = get_the_date();
$excerpt = wp_trim_words(get_the_excerpt(), 30, '…');
$comment_count = (int) get_comments_number();
$categories = get_the_category() ?: [];
$tags = get_the_tags() ?: [];
?>
<article <?php post_class('profile-list-item'); ?>>
<article <?php post_class('profile-list-item'); ?> data-post-id="<?php echo esc_attr((string) $post_id); ?>">
<div class="profile-list-item__main">
<div class="profile-list-item__head">
<h3 class="profile-list-item__title">
@@ -89,7 +90,7 @@ $tags = get_the_tags() ?: [];
break;
}
if ('unfavorite' === $action_type) :
?>
?>
<button type="button" class="<?php echo esc_attr($action_class); ?>" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-action="unfavorite" title="<?php echo esc_attr($action_label); ?>">
<span class="profile-list-item__action-icon"><?php echo $icon_svg; // phpcs:ignore ?></span>
<span class="profile-list-item__action-label"><?php echo esc_html($action_label); ?></span>
@@ -101,6 +102,12 @@ $tags = get_the_tags() ?: [];
</a>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($delete_action['enabled'])) : ?>
<button type="button" class="profile-list-item__action profile-list-item__action--delete" data-action="delete-post" data-post-id="<?php echo esc_attr((string) $post_id); ?>" data-nonce="<?php echo esc_attr((string) ($delete_action['nonce'] ?? '')); ?>">
<span class="profile-list-item__action-label"><?php esc_html_e('删除', 'aksrt'); ?></span>
</button>
<?php endif; ?>
</div>
</div>
</article>