Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Ameya Barve

    (@ameyabarve)

    Hi Nick,

    Thanks for the detailed explanation. I copied the strava.svg file to the plugin root folder and the following code worked:

    //* Add Strava Simple Social Icons widget
    add_filter( 'simple_social_default_profiles', 'ameya_add_strava_simple_icon' );
    function ameya_add_strava_simple_icon( $icons ) {
        $icons['strava-icon'] = [
            'label'   => __( 'Strava URI', 'simple-social-icons' ),
            'pattern' => '<li class="social-strava"><a href="%s" %s><svg role="img" class="social-strava-svg" aria-labelledby="social-strava"><title id="social-strava">' . __( 'Strava', 'simple-social-icons' ) . '</title><use xlink:href="' . esc_url( plugin_dir_url(__FILE__) . 'strava.svg#social-strava' ) . '"></use></svg></a></li>', 
       ];
        return $icons;
    }

    Curiously if I copy the strava.svg to the “wp-content/plugins/simple-social-icons/icons/SVG/” folder, then neither using “esc_url( plugin_dir_url(__FILE__) . ‘icons/SVG/strava.svg#social-strava'” or even a direct link to that location seemed to work.

    Also, I’m new to customizing plugins, so what would you say is the recommended best practice as to where I should keep the strava.svg file? Should I keep it in the Simple Social Icons plugin root folder (as it is now) or would you recommend I move it someplace else?

    Ameya

Viewing 1 replies (of 1 total)