Closed ADAPTiveBen closed 4 years ago
In https://github.com/jaredatch/Shared-Counts/commit/b230d16df308ed812c715535fecb64de8c635779 we updated how Shared Counts retrieves data from Facebook. You should now received like, share, and comment data individually.
Note: Facebook now requires an access token to retrieve this data. Go to Settings > Shared Counts and click the link under the access token field for information on how to get one.
When using the individual Facebook like and share buttons (as opposed to the combined Facebook button) the respective like and share counts are not displayed.
The counts are saved internally, however. So, to fix, you simply need to update lines 211-215 in includes/class-shared-counts-core.php
Original code:
case 'facebook_likes': $share_count = isset( $counts['like_count'] ) ? $counts['like_count'] : '0'; break; case 'facebook_shares': $share_count = isset( $counts['share_count'] ) ? $counts['share_count'] : '0';
Updated code:
case 'facebook_likes': $share_count = isset( $counts['Facebook']['like_count'] ) ? $counts['Facebook']['like_count'] : '0'; break; case 'facebook_shares': $share_count = isset( $counts['Facebook']['share_count'] ) ? $counts['Facebook']['share_count'] : '0';