1. Home
  2. Docs
  3. Subscribe2
  4. Hooks, API & Customization
  5. s2_social_links


This hook was introduced in version 9.3 of Subscribe2. It is now possible to add social sharing links to the HTML notifications. Facebook and Twitter are enabled by default. If you prefer to switch this feature off you need the following code. Social Links uses the AddThis service and therefore offers a wide selection of available services.

function s2_social_links_off() {return array();}add_filter('s2_social_links', 's2_social_links_off');

Or if you prefer you can turn either Facebook or Twitter off and turn Google on. The following code for example adds Google and turns Facebook off.

function s2_social_twitter_and_google() {return array('twitter', 'google');}add_filter('s2_social_links', 's2_social_twitter_and_google');

Subscribe2 includes Facebook, Twitter and Google+ by default with only the former two activated. If you want to add your own additional social sharing sites you need to use the ‘s2_social_buttons’ filter. Have a look at the social_buttons() function in the class-s2-core.php file to see how this can be done.

Was this article helpful to you? Yes No

How can we help?