Support » Plugin: AddToAny Share Buttons » Add Telegram to Follow Widget

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

    (@micropat)

    Hi there,

    Instead of modifying the plugin’s files directly, you should use a functionality plugin such as the Code Snippets plugin.

    Here’s the hook to create an example follow button (from the plugin’s FAQ):

    function addtoany_add_follow_services( $services ) {
        $services['example_follow_service'] = array(
            'name'        => 'Example Follow Service',
            'icon_url'    => 'https://www.example.com/my-icon.svg',
            'icon_width'  => 32,
            'icon_height' => 32,
            'href'        => 'https://www.example.com/${id}',
        );
        return $services;
    }
    add_filter( 'A2A_FOLLOW_services', 'addtoany_add_follow_services', 10, 1 );

    Here’s the hook to add the Telegram follow button using the existing Telegram icon:

    function addtoany_add_follow_services( $services ) {
        $services['telegram'] = array(
            'name'  => 'Telegram',
            'href'  => 'https://t.me/${id}',
            'icon'  => 'telegram',
            'color' => '2CA5E0',
        );
        return $services;
    }
    add_filter( 'A2A_FOLLOW_services', 'addtoany_add_follow_services', 10, 1 );

    Thanks for the advice, it’s a good point.

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