Merge pull request #7165 from maxrice/tweak-avatar-comment-types

Support avatars for the `review` comment type
This commit is contained in:
Mike Jolley 2015-01-20 08:45:06 +00:00
commit 0539431dd9
1 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,9 @@ class WC_Comments {
// Count comments // Count comments
add_filter( 'wp_count_comments', array( __CLASS__, 'wp_count_comments' ), 10, 2 ); 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; 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(); WC_Comments::init();