Few days ago I worked on a project. Client was wanting extra two new types (review & question) at comment form. All things implemented successfully. Only problem was that avatar for review/comment type was not coming at frontend & backend. I researched too much and got that avatar is allowed for comment type only.
But you can enable it without modify the WordPress files. There have a filter “get_avatar_comment_types” and you can alter the default settings. I just applied following PHP code and added into my theme’s functions.php file. It was working like a charm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
<?php /** * Enable the avatar for different comment types * * @package CoreFunctionality * @author Paul Chinmoy * @since 1.0.0 * @license GPL-2.0+ */ add_filter( 'get_avatar_comment_types', 'paul_enable_avatar_comment_types' ); /* * @param array $types An array of content types. Default only contains 'comment'. */ function paul_enable_avatar_comment_types( $types ) { //* here 'review', 'question' are my custom comment types return array( 'comment', 'review', 'question' ); } |
Leave a Reply