• Resolved geektale

    (@geektale)


    Hi.

    This is a petition, can you add Telegram service to the Follow widget? I put the code in addtoany.services.php on my website but it’s remove on each update. This is the code:

    $A2A_FOLLOW_services = array(

    ‘telegram’ => array(
    ‘name’ => ‘Telegram’,
    ‘href’ => ‘https://t.me/${id}’,
    ‘icon’ => ‘telegram’,
    ‘color’ => ‘2CA5E0’,
    ),

    );

    Thanks.

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 );
    Thread Starter geektale

    (@geektale)

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Telegram to Follow Widget’ is closed to new replies.