feat(navigation): hard-switch to Zibll navigation and Font Awesome 5
This commit is contained in:
1 parent
3c3ddac8be
commit
a0b84977a2
630 files changed
+101647
-11293
No files matched your search
@@ -11,23 +11,9 @@ defined('ABSPATH') || exit;
|
||||
|
||||
class NavWalker extends \Walker_Nav_Menu {
|
||||
|
||||
/** @var array<string,mixed> */
|
||||
private $settings;
|
||||
|
||||
/** @var int[] */
|
||||
public static $submenu_ids = [];
|
||||
|
||||
/**
|
||||
* @param array<string,mixed> $settings
|
||||
*/
|
||||
public function __construct(array $settings = []) {
|
||||
$this->settings = $settings ?: (
|
||||
function_exists('aksrt_get_menu_decoration_settings')
|
||||
? aksrt_get_menu_decoration_settings()
|
||||
: ['icon_enabled' => true, 'badge_enabled' => true]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Skip WP children when parent uses senior submenu.
|
||||
*/
|
||||
@@ -41,18 +27,15 @@ class NavWalker extends \Walker_Nav_Menu {
|
||||
public function start_el(&$output, $item, $depth = 0, $args = null, $id = 0): void {
|
||||
$title = '<span class="menu-item-title">' . $item->title . '</span>';
|
||||
|
||||
$icon_enabled = !empty($this->settings['icon_enabled']);
|
||||
$badge_enabled = !empty($this->settings['badge_enabled']);
|
||||
|
||||
$icon = function_exists('aksrt_menu_pz') ? (string) aksrt_menu_pz((int) $item->ID, 'icon', '') : '';
|
||||
$badge = function_exists('aksrt_menu_pz') ? (string) aksrt_menu_pz((int) $item->ID, 'badge', '') : '';
|
||||
$badge_class = function_exists('aksrt_menu_pz') ? (string) aksrt_menu_pz((int) $item->ID, 'badge_class', '') : '';
|
||||
|
||||
if ($icon && function_exists('aksrt_render_menu_icon')) {
|
||||
$title = aksrt_render_menu_icon($icon, $icon_enabled) . $title;
|
||||
$title = aksrt_render_menu_icon($icon) . $title;
|
||||
}
|
||||
if ($badge && function_exists('aksrt_render_menu_badge')) {
|
||||
$title .= aksrt_render_menu_badge($badge, $badge_class, $badge_enabled);
|
||||
$title .= aksrt_render_menu_badge($badge, $badge_class);
|
||||
}
|
||||
|
||||
$item->title = $title;
|
||||
@@ -208,7 +191,7 @@ class NavWalker extends \Walker_Nav_Menu {
|
||||
if ($link_url !== '') {
|
||||
$target = !empty($args['link']['target']) ? ' target="' . esc_attr((string) $args['link']['target']) . '"' : '';
|
||||
return '<div class="' . esc_attr($class) . '"><a href="' . esc_url($link_url) . '"' . $target . '>'
|
||||
. $title_html . '<i class="fa fa-angle-double-right icon-hover-show" aria-hidden="true"></i></a></div>';
|
||||
. $title_html . '<i class="fa fas fa-angle-double-right icon-hover-show" aria-hidden="true"></i></a></div>';
|
||||
}
|
||||
return '<div class="' . esc_attr($class) . '"><a href="javascript:;">' . $title_html . '</a></div>';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user