用户功能设置收口与废弃后台链路清理
This commit is contained in:
@@ -42,7 +42,8 @@ final class UserRenderer {
|
||||
$card_classes = 'aksrt-user-card is-guest';
|
||||
$cover = '';
|
||||
if (!empty($i['show_cover'])) {
|
||||
$cover = '<div class="aksrt-user-card__cover"><img' . aksrt_get_lazy_attr('lazy_cover', get_theme_file_uri('assets/img/person_background.png'), 'lazyload fit-cover', aksrt_get_lazy_thumb('lg')) . ' alt=""></div>';
|
||||
$cover_url = function_exists('aksrt_get_user_cover_url') ? aksrt_get_user_cover_url(0) : get_theme_file_uri('assets/img/user_t.jpg');
|
||||
$cover = '<div class="aksrt-user-card__cover"><img' . aksrt_get_lazy_attr('lazy_cover', $cover_url, 'lazyload fit-cover', aksrt_get_lazy_thumb('lg')) . ' alt=""></div>';
|
||||
} else {
|
||||
$card_classes .= ' no-cover';
|
||||
}
|
||||
@@ -83,7 +84,8 @@ final class UserRenderer {
|
||||
private static function profile_card(\WP_User $user, array $i, bool $self_card): string {
|
||||
$user_id = (int) $user->ID;
|
||||
$home = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user) : get_author_posts_url($user_id);
|
||||
$cover = (string) get_user_meta($user_id, 'aksrt_background_image', true);
|
||||
$cover = function_exists('aksrt_get_user_cover_url') ? aksrt_get_user_cover_url($user_id) : '';
|
||||
$description = function_exists('aksrt_get_user_description') ? aksrt_get_user_description($user_id) : (string) $user->description;
|
||||
$followers = class_exists('AKSRT\\User\\Follow') ? \AKSRT\User\Follow::get_instance()->get_follower_count($user_id) : 0;
|
||||
$following = class_exists('AKSRT\\User\\Follow') ? \AKSRT\User\Follow::get_instance()->get_following_count($user_id) : 0;
|
||||
$html = '<article class="aksrt-user-card' . (!$self_card ? ' is-author' : '') . (empty($i['show_cover']) ? ' no-cover' : '') . '">';
|
||||
@@ -94,7 +96,7 @@ final class UserRenderer {
|
||||
if (function_exists('aksrt_render_user_identity_chips')) {
|
||||
$html .= '<div class="aksrt-user-card__identity">' . aksrt_render_user_identity_chips($user_id, 'widget') . '</div>';
|
||||
}
|
||||
$html .= '<p>' . esc_html(wp_trim_words((string) $user->description, 24)) . '</p><div class="aksrt-user-card__stats"><span><b>' . number_format_i18n(count_user_posts($user_id, 'post', true)) . '</b>' . esc_html__('文章', 'aksrt') . '</span><span><b>' . number_format_i18n($followers) . '</b>' . esc_html__('粉丝', 'aksrt') . '</span><span><b>' . number_format_i18n($following) . '</b>' . esc_html__('关注', 'aksrt') . '</span></div>';
|
||||
$html .= '<p>' . esc_html(wp_trim_words($description, 24)) . '</p><div class="aksrt-user-card__stats"><span><b>' . number_format_i18n(count_user_posts($user_id, 'post', true)) . '</b>' . esc_html__('文章', 'aksrt') . '</span><span><b>' . number_format_i18n($followers) . '</b>' . esc_html__('粉丝', 'aksrt') . '</span><span><b>' . number_format_i18n($following) . '</b>' . esc_html__('关注', 'aksrt') . '</span></div>';
|
||||
if (!empty($i['show_buttons'])) {
|
||||
$html .= '<div class="aksrt-user-card__actions">' . self::action((string) $i['primary_action'], $user, true) . self::action((string) $i['secondary_action'], $user, false) . '</div>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user