jaredatch / Shared-Counts

WordPress plugin that leverages SharedCount.com API to quickly retrieve, cache, and display various social sharing counts.
GNU General Public License v2.0
48 stars 16 forks source link

Add share type parameter to shared_counts_link_url filter #105

Closed ozzyrod closed 4 years ago

ozzyrod commented 4 years ago

It would be nice to update the shared link URL based on the share type. This would allow users to add social network specific parameters. For example, users may want to have different utm parameters for Facebook and Twitter depending on the campaign that they're running.

Plugin Version

1.3.0

Current Behavior

Currently, the filters only allows one parameter. This doesn't allow the user to check which share type the link is for, at least not very easily.

Expected Behavior

By adding a second parameter, $link['type'], to theshared_counts_link_url` filter, a user could easily check if they'd like.

Possible Solution

Add a second parameter to the shared_counts_link_url filter.

billerickson commented 4 years ago

Is there any additional data in the $link array that might be useful when customizing the link URL? What if we passed the entire $link in the filter rather than just $link['type']? That would achieve the same goal but also provide additional information.

ozzyrod commented 4 years ago

I can't think of a use case, but access to additional data is always nice, even if they might be edge cases. I thought about trying to do that, but I was concerned about creating a breaking change in the plugin and decided against going that route.

Let me know how y'all would like to handle it. I can always update the PR accordingly if you'd like.

billerickson commented 4 years ago

If you can update the PR to use $link instead of $link['type'], I'll merge it in.

Thanks

ozzyrod commented 4 years ago

No problem and thank you!

It's been updated in PR #106

billerickson commented 4 years ago

It's now merged, thank you!