用户中心减层:收敛本人入口与 panel 契约
This commit is contained in:
1 parent
31c95c3bc6
commit
dec33ea15a
33 files changed
+1585
-1488
No files matched your search
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* User center profile favorites part.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
||||
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
||||
?>
|
||||
<!-- ==================== 我的收藏 ==================== -->
|
||||
<div class="widget-card">
|
||||
<div class="profile-list-header">
|
||||
<h3 class="widget-title widget-title--inline">
|
||||
<?php printf( esc_html__( '我的收藏(%d 篇)', 'aksrt' ), $favorite_count ); ?>
|
||||
</h3>
|
||||
</div>
|
||||
<?php if ( ! empty( $favorite_post_ids ) ) :
|
||||
$favorites_query = new WP_Query( [
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'publish',
|
||||
'post__in' => $favorite_post_ids,
|
||||
'orderby' => 'post__in',
|
||||
'posts_per_page' => $per_page,
|
||||
'paged' => $favorites_page,
|
||||
'ignore_sticky_posts' => true,
|
||||
'no_found_rows' => false,
|
||||
'update_post_meta_cache' => false,
|
||||
] );
|
||||
if ( $favorites_query->have_posts() ) : ?>
|
||||
<div class="profile-list" data-list="favorites">
|
||||
<?php while ( $favorites_query->have_posts() ) : $favorites_query->the_post();
|
||||
get_template_part('templates/parts/content', 'profile-list-item', [
|
||||
'action' => [
|
||||
'type' => 'unfavorite',
|
||||
'url' => '#',
|
||||
'label' => __('取消收藏', 'aksrt'),
|
||||
],
|
||||
]);
|
||||
endwhile; ?>
|
||||
</div>
|
||||
<?php aksrt_render_profile_pagination( (int) $favorites_query->max_num_pages, $favorites_page, 'favorites_page' ); ?>
|
||||
<?php
|
||||
wp_reset_postdata();
|
||||
else :
|
||||
aksrt_render_profile_empty(
|
||||
$svg_empty_favorite,
|
||||
__( '收藏列表为空', 'aksrt' ),
|
||||
__( '点击文章页面的星标收藏喜欢的内容。', 'aksrt' ),
|
||||
home_url( '/' ),
|
||||
__( '去发现好文', 'aksrt' )
|
||||
);
|
||||
endif;
|
||||
else :
|
||||
aksrt_render_profile_empty(
|
||||
$svg_empty_favorite,
|
||||
__( '收藏列表为空', 'aksrt' ),
|
||||
__( '点击文章页面的星标收藏喜欢的内容。', 'aksrt' ),
|
||||
home_url( '/' ),
|
||||
__( '去发现好文', 'aksrt' )
|
||||
);
|
||||
endif; ?>
|
||||
</div>
|
||||
Reference in new issue
Block a user