$ctx */ function aksrt_nav_mobile_shell(array $ctx): void { $align = (string) ($ctx['mobile_align'] ?? 'left'); if (!in_array($align, ['top', 'left', 'right'], true)) { $align = 'left'; } $touch_attr = ''; if ($align !== 'top') { $touch_attr = ' mini-touch="mobile-nav" touch-direction="' . esc_attr($align) . '"'; } echo '
'; echo ''; $brand_name = (string) ($ctx['brand_name'] ?? get_bloginfo('name')); $logo_inner = !empty($ctx['logo_html']) ? $ctx['logo_html'] : '' . esc_html($brand_name) . ''; echo '
'; echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo ''; echo '
'; aksrt_nav_mobile_content($ctx); if (is_active_sidebar('mobile_nav_fluid')) { echo '
'; dynamic_sidebar('mobile_nav_fluid'); echo '
'; } echo ''; echo '
'; echo '
'; } endif; if (!function_exists('aksrt_nav_mobile_content')) : /** * Mobile menu list + top toggles + user box. * * @param array $ctx */ function aksrt_nav_mobile_content(array $ctx): void { $top_btns = ''; if (in_array('m_menu', (array) ($ctx['theme_positions'] ?? []), true)) { $top_btns .= ''; $top_btns .= ''; $top_btns .= ''; } if (function_exists('aksrt_get_translate_language_btn')) { $top_btns .= aksrt_get_translate_language_btn('pull-right'); } if ($top_btns !== '') { echo '
' . $top_btns . '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } $location = has_nav_menu('mobile') ? 'mobile' : 'primary'; $walker = class_exists('\AKSRT\Frontend\NavWalker') ? new \AKSRT\Frontend\NavWalker() : null; $args = [ 'container' => false, 'echo' => false, 'fallback_cb' => false, 'depth' => 2, 'items_wrap' => '', 'theme_location' => $location, ]; if ($walker) { $args['walker'] = $walker; } $menu = has_nav_menu($location) ? (string) wp_nav_menu($args) : ''; if ($menu === '' && $location !== 'primary' && has_nav_menu('primary')) { $args['theme_location'] = 'primary'; $menu = (string) wp_nav_menu($args); } if ($menu === '' && is_super_admin()) { $menu = ''; } echo $menu; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped if (is_singular('post')) { echo '
'; } // User box at bottom of drawer. echo aksrt_header_user_box_html($ctx); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } endif;