修复了一些问题
This commit is contained in:
@@ -173,9 +173,10 @@ if (!function_exists('aksrt_header_user_box_html')) :
|
||||
$badges = function_exists('aksrt_header_user_badges_row') ? aksrt_header_user_badges_row($user_id) : '';
|
||||
$unread = (int) ($ctx['unread_count'] ?? 0);
|
||||
$msg_url = (string) ($ctx['messages_url'] ?? '');
|
||||
$positions = (array) ($ctx['message_icon_positions'] ?? []);
|
||||
|
||||
$msg_icon = '';
|
||||
if ($msg_url !== '') {
|
||||
if ($msg_url !== '' && in_array('avatar_dropdown', $positions, true)) {
|
||||
$msg_icon = '<a class="abs-right" href="' . esc_url($msg_url) . '" title="' . esc_attr__('消息中心', 'aksrt') . '">';
|
||||
$msg_icon .= '<i class="fa fas fa-bell" aria-hidden="true"></i>';
|
||||
if ($unread > 0) {
|
||||
@@ -304,7 +305,21 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
$utility_buttons .= aksrt_get_translate_language_btn('aksrt-navbar-language');
|
||||
}
|
||||
|
||||
// User + search.
|
||||
// Notifications, user and search.
|
||||
$notification_but = '';
|
||||
$messages_url = (string) ($ctx['messages_url'] ?? '');
|
||||
$positions = (array) ($ctx['message_icon_positions'] ?? []);
|
||||
if ($user_id > 0 && $messages_url !== '' && in_array('nav_menu', $positions, true)) {
|
||||
$unread = (int) ($ctx['unread_count'] ?? 0);
|
||||
$notification_but = '<li class="relative"><a rel="nofollow" href="' . esc_url($messages_url)
|
||||
. '" class="aksrt-nav-icon aksrt-nav-notification" aria-label="' . esc_attr__('消息中心', 'aksrt') . '">'
|
||||
. '<i class="fa fas fa-bell" aria-hidden="true"></i>';
|
||||
if ($unread > 0) {
|
||||
$notification_but .= '<span class="aksrt-notification-badge">' . esc_html((string) min(99, $unread)) . '</span>';
|
||||
}
|
||||
$notification_but .= '</a></li>';
|
||||
}
|
||||
|
||||
$sign_but = '';
|
||||
$user_sub = '<div class="padding-10">' . aksrt_header_user_box_html($ctx) . '</div>';
|
||||
if ('2' === $layout) {
|
||||
@@ -333,7 +348,7 @@ if (!function_exists('aksrt_menu_button')) :
|
||||
|
||||
$account = '<ul class="list-inline splitters relative aksrt-navbar-account'
|
||||
. ($user_id <= 0 && '2' === $layout ? ' navbar-text' : '') . '">'
|
||||
. $sign_but . $search_but . '</ul>';
|
||||
. $notification_but . $sign_but . $search_but . '</ul>';
|
||||
$button = '<div class="aksrt-navbar-actions navbar-form navbar-right">'
|
||||
. $actions . $utility_buttons . $account . '</div>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user