I have a search item in my uber menu. After updating to x-theme 6.1.5, Cornerstone 3.1.5 and ubermenu 3.4.0.1, it stopped working. It is controlled by a function in my childtheme. After the update it treats the anchor as a normal anchor pointing the “#”. Before it opened a search overlay.
I understand things change, so I’m happy to go in a different direction, but I’d like some help on either fixing the existing setup or building an equivalent.
function x_navbar_search_navigation_item( $items, $args ) {
if ( x_get_option( 'x_header_search_enable' ) == '1' ) {
if ( $args->theme_location == 'ubermenu' ) {
if ( ! class_exists( 'UberMenu' ) ) {
$items .= '<li class="menu-item x-menu-item x-menu-item-search">'
. '<a href="#" class="x-btn-navbar-search">'
. __( 'Search', '__x__' ) . '</span></span>' . '<span><i class="x-icon-search" data-x-icon="" aria-hidden="true"></i><span> '
. '</a>'
. '</li>';
} else {
$items .= '<li class="ubermenu-item ubermenu-item-level-0 x-menu-item x-menu-item-search">'
. '<a href="#" class="x-btn-navbar-search ubermenu-target">'
. __( 'Search', '__x__' ) . '</span></span>' . '<span><i class="x-icon-search" data-x-icon="" aria-hidden="true"></i><span> '
. '</a>'
. '</li>';
}
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'x_navbar_search_navigation_item', 9998, 2 );