Make WordPress Core

Changeset 13231


Ignore:
Timestamp:
02/19/2010 08:27:56 PM (15 years ago)
Author:
nacin
Message:

Add filter to get_avatar() to allow avatars for custom comment types. Props usermrpapa. Fixes #11880

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r13206 r13231  
    15831583            $email = $user->user_email;
    15841584    } elseif ( is_object($id_or_email) ) {
    1585         if ( isset($id_or_email->comment_type) && '' != $id_or_email->comment_type && 'comment' != $id_or_email->comment_type )
    1586             return false; // No avatar for pingbacks or trackbacks
     1585        // No avatar for pingbacks or trackbacks
     1586        $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) );
     1587        if ( ! empty( $id_or_email->comment_type ) && ! in_array( $id_or_email->comment_type, (array) $allowed_comment_types ) )
     1588            return false;
    15871589
    15881590        if ( !empty($id_or_email->user_id) ) {
Note: See TracChangeset for help on using the changeset viewer.