Last active
March 23, 2017 05:41
-
-
Save MrJSdev/e60d4b0fcfe98c744abba606d10bb007 to your computer and use it in GitHub Desktop.
Facebook comment Count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Facebook for Comment Count | |
* @link http://extracatchy.net/add-facebook-comments-in-wordpress/ | |
* | |
* @param int $count | |
* @param int $post_id | |
* @return int $count | |
*/ | |
function ea_facebook_for_comment_count( $count, $post_id ) { | |
if( ! function_exists( 'ea_share' ) ) | |
return $count; | |
return ea_share()->core->count( $post_id, 'facebook_comments' ); | |
} | |
add_filter( 'get_comments_number', 'ea_facebook_for_comment_count', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment