ID; $home_url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($user) : home_url('/'); $show_cover = !array_key_exists('cover', $settings) || !empty($settings['cover']); $show_follow = !array_key_exists('follow', $settings) || !empty($settings['follow']); $show_avatar = !array_key_exists('avatar', $settings) || !empty($settings['avatar']); $show_name = !array_key_exists('name', $settings) || !empty($settings['name']); $show_desc = !array_key_exists('desc', $settings) || !empty($settings['desc']); $profile_details = is_array($dashboard['profile_details'] ?? null) ? $dashboard['profile_details'] : []; // 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']); $bg_url = function_exists('aksrt_get_user_cover_url') ? aksrt_get_user_cover_url($user_id) : ''; $is_own = !empty($dashboard['is_own_profile']); $follower_count = (int) ($tab_counts['follow'] ?? 0); if ($follower_count <= 0 && class_exists('\AKSRT\User\Follow')) { $follower_count = (int) \AKSRT\User\Follow::get_instance()->get_follower_count($user_id); } $notification_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::notification_settings() : ['enabled' => false, 'icon_show' => []]; $show_header_notification = !empty($notification_settings['enabled']) && in_array('user_home_header', (array) ($notification_settings['icon_show'] ?? []), true); $messages_url = $show_header_notification && function_exists('aksrt_get_messages_page_url') ? aksrt_get_messages_page_url() : ''; $unread_count = $is_own ? aksrt_get_user_unread_notification_count($user_id) : 0; ?>