Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Evan Herman

    (@eherman24)

    Hi @wiedii,

    We used to have support for YouTube icons but the way the links to the YouTube profile are structured it didn’t work properly. You used to be able to use your account name to link directly to a YouTube channel.

    Since YouTube now allows multiple channels per account, the username doesn’t necessarily link to a YouTube channel so providing the YouTube username sometimes lead to a 404 page. I believe newer channel URLs are structured as /channel/channel_ID whereas channels that have been around for a while URLs are /users/username . So the discrepency in the URLs forced us to deprecate the option until we (or YouTube) have a better solution.

    You can still use the filters built into the plugin to enable your own YouTube icon. We have a Q+A in the FAQ section of the repo here.

    The following snippet of code should help get you off on the right foot. You’ll want to add to your themes functions.php file, and should re-enable the YouTube link for you, which you can then populate with the proper URL.

    
    add_filter( 'wpcw_widget_social_custom_fields', function ( $fields, $instance ) {
    
        $fields['youtube'] = [
            'icon'      => 'youtube',
            'label'     => __( 'YouTube', 'YOURTEXTDOMAIN' ),
            'default'   => 'https://www.youtube.com/channel/channel_ID',
            'select'    => 'channel_ID',
            'sanitizer' => 'esc_url_raw',
            'escaper'   => 'esc_url',
            'social'    => true,
            'target'    => '_blank',
        ];
    
        return $fields;
    
    }, 10, 2 );
    

    That will create something like this on the backend:
    https://cldup.com/L5zl_Fi3Xe.png

    and the following when displayed on the site:
    https://cldup.com/GfTrWo7zC4.png

    Let us know how that works for you.

    • This reply was modified 7 years, 11 months ago by Evan Herman.
    Thread Starter wiedii

    (@wiedii)

    Works great! Thank you @eherman24!

    • This reply was modified 7 years, 11 months ago by wiedii.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘No icons for youtube.com’ is closed to new replies.