Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created April 27, 2016 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/6c46e2a6e18110b2fa312ef6f94ee503 to your computer and use it in GitHub Desktop.
Save billerickson/6c46e2a6e18110b2fa312ef6f94ee503 to your computer and use it in GitHub Desktop.
<?php
/**
* Facebook for Comment Count
*
* @author Bill Erickson
* @link http://www.billerickson.net/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