Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Support request] suggestion feature svg

Home Forums Support [Support request] suggestion feature svg

Home Forums Support suggestion feature svg

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #950086
    Sebastien

    Hi,

    This is about the new svg inline that you implement in the last version.
    It would be very nice to be able to use a filter to customize the title of the svg <svg><title> customized title</title></svg> used in GP.
    Or at least a filter to replace the full <svg></svg> in this case I could manage myself the title.

    πŸ™‚

    see you !

    #950180
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    That filter exists:

    add_filter( 'generate_svg_icon', function( $output, $icon ) {
        if ( 'menu-bars' === $icon ) {
            $svg = 'your SVG code here';
    
            $output = sprintf( 
                '<span class="gp-icon %1$s">%2$s</span>',
                $icon,
                $svg
            );
        }
    
        return $output;
    }, 10, 2 );

    You can see the available icons to target here: https://github.com/tomusborne/generatepress/blob/2.3.2/inc/theme-functions.php#L235

    Hope this helps πŸ™‚

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.