修复了一些一些已知问题
This commit is contained in:
@@ -33,7 +33,7 @@ final class UserRenderer {
|
||||
$oauth_html = (string) $oauth->get_login_buttons();
|
||||
}
|
||||
}
|
||||
return '<div class="aksrt-user-card is-guest"><div class="aksrt-user-card__cover"></div><div class="aksrt-user-card__body">' . (function_exists('aksrt_get_avatar_html') ? aksrt_get_avatar_html(0, 88) : get_avatar(0, 88)) . '<h3>' . esc_html__('Hi,请登录', 'aksrt') . '</h3><p>' . esc_html__('登录后管理课程、会员、订单与创作内容。', 'aksrt') . '</p><div class="aksrt-user-card__actions"><a class="aksrt-widget-button signin-loader" href="' . esc_url($login) . '">' . esc_html__('登录', 'aksrt') . '</a><a class="aksrt-widget-button is-ghost signup-loader" href="' . esc_url($register) . '">' . esc_html__('注册', 'aksrt') . '</a></div>' . ($oauth_html !== '' ? '<div class="aksrt-user-card__oauth">' . $oauth_html . '</div>' : '') . '</div></div>';
|
||||
return '<div class="aksrt-user-card is-guest"><div class="aksrt-user-card__cover"></div><div class="aksrt-user-card__body">' . (function_exists('aksrt_get_avatar_html') ? aksrt_get_avatar_html(0, 88) : get_avatar(0, 88)) . '<h3>' . esc_html__('Hi,请登录', 'aksrt') . '</h3><p>' . esc_html__('登录后管理课程、会员、订单与创作内容。', 'aksrt') . '</p><div class="aksrt-user-card__actions"><a class="aksrt-widget-button is-primary signin-loader" href="' . esc_url($login) . '">' . esc_html__('登录', 'aksrt') . '</a><a class="aksrt-widget-button is-secondary signup-loader" href="' . esc_url($register) . '">' . esc_html__('注册', 'aksrt') . '</a></div>' . ($oauth_html !== '' ? '<div class="aksrt-user-card__oauth">' . $oauth_html . '</div>' : '') . '</div></div>';
|
||||
}
|
||||
$user = get_userdata($user_id);
|
||||
return $user instanceof \WP_User ? self::profile_card($user, $i, true) : '';
|
||||
@@ -79,8 +79,9 @@ final class UserRenderer {
|
||||
|
||||
private static function action(string $action, \WP_User $user, bool $primary): string {
|
||||
$labels = ['home' => __('个人主页', 'aksrt'), 'submit' => __('发布文章', 'aksrt'), 'vip' => __('会员中心', 'aksrt'), 'orders' => __('订单中心', 'aksrt'), 'recharge' => __('余额充值', 'aksrt'), 'signin' => __('签到', 'aksrt')];
|
||||
$variant = $primary ? ' is-primary' : ' is-secondary';
|
||||
if ($action === 'signin' && function_exists('aksrt_header_user_checkin_btn') && get_current_user_id() === (int) $user->ID) {
|
||||
return '<span class="aksrt-user-card__checkin">' . aksrt_header_user_checkin_btn((int) $user->ID, true) . '</span>';
|
||||
return '<span class="aksrt-user-card__checkin' . $variant . '">' . aksrt_header_user_checkin_btn((int) $user->ID, true) . '</span>';
|
||||
}
|
||||
if ($action === 'home') {
|
||||
$url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user) : get_author_posts_url((int) $user->ID);
|
||||
@@ -93,7 +94,7 @@ final class UserRenderer {
|
||||
if ($url === '') {
|
||||
return '';
|
||||
}
|
||||
return '<a class="aksrt-widget-button' . (!$primary ? ' is-ghost' : '') . '" href="' . esc_url($url) . '">' . esc_html($labels[$action] ?? $labels['home']) . '</a>';
|
||||
return '<a class="aksrt-widget-button' . $variant . '" href="' . esc_url($url) . '">' . esc_html($labels[$action] ?? $labels['home']) . '</a>';
|
||||
}
|
||||
|
||||
private static function ranking(array $i): string {
|
||||
|
||||
Reference in New Issue
Block a user