Shared-Counts
Shared-Counts copied to clipboard
Pinterest URL params missing with pinit.js
In #34 we restored the Pinterest button if pinit.js is running.
However all the URL params present in the original URL (description and media) are not available.
For the Pinterest button, we would probably need to add data-description and data-media, then read that from the JS and add the the URL we use to fix the button.
I think it would be safer to add a data-href attribute with the full URL and restore from that.
Right now the only way to customize the description is to rebuild the URL. That's how the Shared Counts - Pinterest Image plugin does it (see code).
If we do store the description and media separately, we'll need to add a filter for customizing the description and update the Pinterest Image addon plugin to use it.
As suggested by @billerickson
Hook late into
shared_counts_link(99 priority or something) and add something like$link['data']['href'] = $link['link']` or whatever it is we use for data attributes.
Then update the JS and attempt to restore URL from data attribute.