From 96bc2ff25edb010a756f3d1d99bc1b9044e2bffc Mon Sep 17 00:00:00 2001 From: Max Rice Date: Tue, 20 Jan 2015 00:26:33 -0500 Subject: [PATCH] Support avatars for the `review` comment type --- includes/class-wc-comments.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/class-wc-comments.php b/includes/class-wc-comments.php index 3a996d46059..f7446f95e22 100644 --- a/includes/class-wc-comments.php +++ b/includes/class-wc-comments.php @@ -40,6 +40,9 @@ class WC_Comments { // Count comments add_filter( 'wp_count_comments', array( __CLASS__, 'wp_count_comments' ), 10, 2 ); + + // support avatars for `review` comment type + add_filter( 'get_avatar_comment_types', array( __CLASS__, 'add_avatar_for_review_comment_type' ) ); } /** @@ -267,6 +270,18 @@ class WC_Comments { return $stats; } + + /** + * Make sure WP displays avatars for comments with the `review` type + * + * @since 2.3 + * @param array $comment_types + * @return array + */ + public static function add_avatar_for_review_comment_type( $comment_types ) { + + return array_merge( $comment_types, array( 'review' ) ); + } } WC_Comments::init();