The shared_counts_single filter lets you customize the share count for a service not built into the plugin (see here). But there's no way to target it by service type, or access the post ID.
If you add an additional button, you can't currently set the count for that button using this filter - it's too generic. We need to include the $id and $type.
Here's a real world example. I'm extending Shared Counts to include a site-specific liking button (BE Like Content).
After adding the $id and $type to the filter above, I'm able to set the button's count using this code:
The
shared_counts_single
filter lets you customize the share count for a service not built into the plugin (see here). But there's no way to target it by service type, or access the post ID.If you add an additional button, you can't currently set the count for that button using this filter - it's too generic. We need to include the
$id
and$type
.Here's a real world example. I'm extending Shared Counts to include a site-specific liking button (BE Like Content).
After adding the
$id
and$type
to the filter above, I'm able to set the button's count using this code:Once this has been merged into core, we should update the wiki to provide this example.