generate_svg_icon

generate_svg_icon

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(
'
%2$s
',
$icon,
$svg
);
}

return $output;
}, 15, 2 );

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注