Merge pull request #7165 from maxrice/tweak-avatar-comment-types
Support avatars for the `review` comment type
This commit is contained in:
commit
0539431dd9
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue