更多资料新增元信息

This commit is contained in:
2026-08-23 12:51:11 +08:00
parent 54ee4b3bdd
commit 57b12dea80
2 changed files with 21 additions and 3 deletions
+8 -3
View File
@@ -38,9 +38,12 @@ $show_desc = !array_key_exists('desc', $settings) || !empty($settings['desc']);
$show_message = !array_key_exists('message', $settings) || !empty($settings['message']);
$profile_details = is_array($dashboard['profile_details'] ?? null) ? $dashboard['profile_details'] : [];
// Gender is rendered inside the dialog but never creates a standalone menu
// action: without visible social details there is no "更多资料" item.
$has_more_details = !empty($profile_details['website']) || !empty($profile_details['qq']) || !empty($profile_details['wechat']) || !empty($profile_details['github']);
// Registration time is always present, so the details dialog always has
// content and the "更多资料" menu action is always available.
$registered_time = get_date_from_gmt((string) $user->user_registered, 'Y-m-d H:i:s');
$last_login_ts = (int) get_user_meta($user_id, 'aksrt_last_login', true);
$last_login_time = $last_login_ts > 0 ? wp_date('Y-m-d H:i:s', $last_login_ts) : '';
$has_more_details = $registered_time !== '' || $last_login_time !== '' || !empty($profile_details['website']) || !empty($profile_details['qq']) || !empty($profile_details['wechat']) || !empty($profile_details['github']);
$signals = $dashboard['profile_signals'] ?? [];
$notice = $dashboard['profile_notice'] ?? null;
$show_report = !empty($dashboard['show_report']);
@@ -197,6 +200,8 @@ $pm_url = ($pm_enabled && $messages_url !== '')
<?php if (!empty($profile_details['github'])) : ?><div><dt>GitHub</dt><dd><a href="<?php echo esc_url($profile_details['github']); ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($profile_details['github']); ?></a></dd></div><?php endif; ?>
<?php if (!empty($profile_details['qq'])) : ?><div><dt>QQ</dt><dd><?php echo esc_html($profile_details['qq']); ?></dd></div><?php endif; ?>
<?php if (!empty($profile_details['wechat'])) : ?><div><dt><?php esc_html_e('微信', 'aksrt'); ?></dt><dd><?php echo esc_html($profile_details['wechat']); ?></dd></div><?php endif; ?>
<?php if ($registered_time !== '') : ?><div><dt><?php esc_html_e('注册时间', 'aksrt'); ?></dt><dd><?php echo esc_html($registered_time); ?></dd></div><?php endif; ?>
<?php if ($last_login_time !== '') : ?><div><dt><?php esc_html_e('最后登录', 'aksrt'); ?></dt><dd><?php echo esc_html($last_login_time); ?></dd></div><?php endif; ?>
</dl>
</div>
</div>