generate_svg_icon_element

The generate_svg_icon_element filter allows change the default icons used throughout the theme.

The available options are:

menu-bars
close
search
categories
tags
comments
arrow
arrow-right
arrow-left
arrow-up

For example, if you want to use a custom navigation search icon to replace the default one, then this function can be used:

add_filter( 'generate_svg_icon_element', function( $output, $icon ) {
    if ( 'search' === $icon ) {
        $output = '<svg>Your-custom-search-icon</svg>';
    }
    return $output;
}, 10, 2 );

Make sure to only replace your-svg-here with the actual SVG code in the snippet above.

For off canvas menu hamburger/close icon and shopping cart icon, please check another filter: generate_svg_icon