Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function full_comment_count() {
- global $post;
- $url = get_permalink($post->ID);
- $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);
- $json = json_decode($filecontent);
- $id = $json->$url->id;
- $comments = file_get_contents('https://graph.facebook.com/' . $id . '/comments?summary=true');
- $jsoncomments = json_decode($comments);
- var_dump($comments);
- $count = $json->$url->comments;
- $wpCount = get_comments_number();
- $realCount = $count + $wpCount;
- if ($realCount == 0 || !isset($realCount)) {
- $realCount = 0;
- }
- return $realCount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement