修复粉丝/关注 TAB 的用户列表渲染
This commit is contained in:
1 parent
c6c2c0af6d
commit
84321801a6
7 files changed
+109
-72
No files matched your search
@@ -242,11 +242,19 @@ if (!function_exists('aksrt_author_minicard')) :
|
||||
: '<a href="' . esc_url($home) . '">' . esc_html($user->display_name) . '</a>';
|
||||
|
||||
// Follow control (separate from name, legacy places both in dt).
|
||||
// 服务端直接输出真实关注状态(legacy parity: zib_get_user_follow 恒渲染当前态)。
|
||||
$follow = '';
|
||||
$current = get_current_user_id();
|
||||
if ($current !== $user_id) {
|
||||
$is_following = false;
|
||||
if (is_user_logged_in() && class_exists('\AKSRT\User\Follow')) {
|
||||
$is_following = \AKSRT\User\Follow::get_instance()->is_following($current, $user_id);
|
||||
}
|
||||
$follow_label = $is_following ? __('已关注', 'aksrt') : __('关注', 'aksrt');
|
||||
$follow_title = $is_following ? __('点击取消关注', 'aksrt') : __('关注该用户', 'aksrt');
|
||||
$follow_state = $is_following ? ' is-following' : '';
|
||||
if (is_user_logged_in()) {
|
||||
$follow = '<button type="button" class="focus-color px12 ml10 follow flex0 but" data-aksrt-follow="' . (int) $user_id . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</button>';
|
||||
$follow = '<button type="button" class="focus-color px12 ml10 follow flex0 but' . $follow_state . '" data-aksrt-follow="' . (int) $user_id . '" title="' . esc_attr($follow_title) . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html($follow_label) . '</button>';
|
||||
} else {
|
||||
$login = function_exists('aksrt_get_login_url') ? aksrt_get_login_url() : wp_login_url();
|
||||
$follow = '<a class="focus-color px12 ml10 follow flex0 but" href="' . esc_url($login) . '"><i class="fa fas fa-heart em09" aria-hidden="true"></i> ' . esc_html__('关注', 'aksrt') . '</a>';
|
||||
|
||||
Reference in new issue
Block a user