I actually added this code into addtoany.services.php
Your changes to any plugin files will get wiped out after every plugin update, so I recommend following the FAQ on adding a custom follow button.
Just change https://www.example.com/my-minds-icon.svg and add the following PHP code to a “functionality” plugin such as the Code Snippets plugin:
function addtoany_add_follow_services( $services ) {
$services['example_follow_service'] = array(
'name' => 'Minds',
'icon_url' => 'https://www.example.com/my-minds-icon.svg',
'icon_width' => 32,
'icon_height' => 32,
'href' => 'https://www.minds.com/${id}',
);
return $services;
}
add_filter( 'A2A_FOLLOW_services', 'addtoany_add_follow_services', 10, 1 );
Thank you,
I am sorry to bother, I am just not that expert with coding!
so technically i can add whatever, one code for every social media i am going to add, in this way:
function addtoany_add_follow_services( $services ) {
$services[‘example_follow_service’] = array(
‘name’ => ‘whatever’,
‘icon_url’ => ‘https://urltomyicon’,
‘icon_width’ => 32,
‘icon_height’ => 32,
‘href’ => ‘https://www.whatever.blahblah/${id}’,
);
return $services;
}
add_filter( ‘A2A_FOLLOW_services’, ‘addtoany_add_follow_services’, 10, 1 );
Or i have to add in ONE snippet more than one?
like this:
function addtoany_add_follow_services( $services ) {
$services[‘example_follow_service’] = array(
‘name’ => ‘whatever1’,
‘icon_url’ => ‘https://urltomyicon1’,
‘icon_width’ => 32,
‘icon_height’ => 32,
‘href’ => ‘https://www.whatever.blahblah1/${id}’,
);
return $services;
}
{
$services[‘example_follow_service’] = array(
‘name’ => ‘whatever2’,
‘icon_url’ => ‘https://urltomyicon2’,
‘icon_width’ => 32,
‘icon_height’ => 32,
‘href’ => ‘https://www.whatever.blahblah2/${id}’,
);
return $services;
add_filter( ‘A2A_FOLLOW_services’, ‘addtoany_add_follow_services’, 10, 1 );
-
This reply was modified 2 years, 3 months ago by
pressvibes.
-
This reply was modified 2 years, 3 months ago by
pressvibes.
-
This reply was modified 2 years, 3 months ago by
pressvibes.
Hello everyone,
I did play with code snippet and I found a solution to add as many I want, I paste it here, just in case someone will have the same need, with code snippet this is the code that perfectly works when you want to add more:
function addtoany_add_follow_services( $services ) {
$services['example_follow_service_minds'] = array(
'name' => 'Minds',
'icon_url' => 'URL.TO.MINDS.ICON',
'icon_width' => 32,
'icon_height' => 32,
'href' => 'https://www.minds.com/${id}',
);
$services['example_follow_service_reddit'] = array(
'name' => 'Reddit',
'icon_url' => 'URL.TO.REDDIT.ICON',
'icon_width' => 32,
'icon_height' => 32,
'href' => 'https://www.reddit.com/user/${id}',
);
$services['example_follow_service_NAMESERVICE'] = array(
'name' => 'NAMESERVICE',
'icon_url' => 'URL.TO.THE.ICON',
'icon_width' => 32,
'icon_height' => 32,
'href' => 'URL.TO.SOCIALMEDIA.WITHOUT.YOUR.ID/${id}',