Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinterest URL params missing with pinit.js #95

Open
jaredatch opened this issue Feb 3, 2020 · 2 comments
Open

Pinterest URL params missing with pinit.js #95

jaredatch opened this issue Feb 3, 2020 · 2 comments
Labels

Comments

@jaredatch
Copy link
Owner

jaredatch commented Feb 3, 2020

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.

@jaredatch jaredatch added the bug label Feb 3, 2020
@billerickson
Copy link
Collaborator

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.

@jaredatch
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants