The generate_svg_icon filter allows you to overwrite the entire HTML output of the icon, including the surrounding gp_icon element.
For example, if you want to change the default menu cart icon to a custom icon, then this snippet can be used:
add_filter( 'generate_svg_icon', function( $output, $icon ) {
if ( 'shopping-cart' === $icon ) {
$svg = '
';
return sprintf(
' ',
$icon,
$svg
);
}
return $output;
}, 15, 2 );