Snippet: Remove The Superfish Dropdown Script From Header Menu
Important: In Total 5.3+ you can now choose your header menu dropdown method (superfish, CSS hover or click) so you don't need this code anymore, instead you can simply select a different dropdown style then the default.
// Remove Superfish script.
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_script( 'wpex-superfish' );
}, 99 );
// Remove superfish localized data (OPTIONAl).
add_filter( 'wpex_localize_array', function( $array ) {
if ( is_array( $array ) ) {
unset( $array['superfishDelay'] );
unset( $array['superfishSpeed'] );
unset( $array['superfishSpeedOut'] );
}
return $array;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
We recommend Code Snippets (100% Free) or WPCode (sponsored)