mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 23:57:41 +02:00
Add filter to get_avatar() to allow avatars for custom comment types. Props usermrpapa. Fixes #11880
git-svn-id: http://svn.automattic.com/wordpress/trunk@13231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f1032cf165
commit
8d39376b5a
@ -1582,8 +1582,10 @@ function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
|
|||||||
if ( $user )
|
if ( $user )
|
||||||
$email = $user->user_email;
|
$email = $user->user_email;
|
||||||
} elseif ( is_object($id_or_email) ) {
|
} elseif ( is_object($id_or_email) ) {
|
||||||
if ( isset($id_or_email->comment_type) && '' != $id_or_email->comment_type && 'comment' != $id_or_email->comment_type )
|
// No avatar for pingbacks or trackbacks
|
||||||
return false; // No avatar for pingbacks or trackbacks
|
$allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );
|
||||||
|
if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
if ( !empty($id_or_email->user_id) ) {
|
if ( !empty($id_or_email->user_id) ) {
|
||||||
$id = (int) $id_or_email->user_id;
|
$id = (int) $id_or_email->user_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user