Snippets: Disable Menu Widget Accordion Toggle JS

This code will disable the default toggles for the WordPress menu widget in the Total theme. Important: This is a 2 step process so some code needs to go in your child theme's functions.php file and some goes wherever you add custom CSS.

// PHP CODE - Add to child theme's functions.php file
add_filter( 'wpex_localize_array', function( $array ) {
	unset( $array['menuWidgetAccordion'] );
	return $array;
} );

/* CSS CODE - Add to Theme Panel > Custom CSS or child theme style.css */
#sidebar .widget_nav_menu .sub-menu, .widget_nav_menu_accordion .widget_nav_menu .sub-menu { display: block !important; }

Snippet Type: PHP

Posted Under: Widgets

All PHP snippets should be added via a child theme's functions.php file.