Add onclick to the links
-
Hi,
Thanks for this great plugin!
I am trying to track how many clicks I get on my sharing buttons to see if it is worth keeping it for my blog.
Looking at the source code, it seems to be possible with a filter and adding something to each button ‘data’, but it does not seem to work.
Here is what I have done:
function tps_scriptlesssocialsharing_buttons($buttons) { $buttons['twitter']['data'] = ' onclick="handleSocialClick(this);" '; $buttons['facebook']['data'] = ' onclick="handleSocialClick(this);" '; $buttons['pinterest']['data'] = ' onclick="handleSocialClick(this);" '; $buttons['linkedin']['data'] = ' onclick="handleSocialClick(this);" '; return $buttons; } add_filter( 'scriptlesssocialsharing_buttons', 'tps_scriptlesssocialsharing_buttons' );
How can I achieve this?
Thanks!
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Add onclick to the links’ is closed to new replies.