Skip to:
Content

BuddyPress.org

Changeset 12177


Ignore:
Timestamp:
06/19/2018 02:22:35 AM (6 years ago)
Author:
boonebgorges
Message:

Remove unreachable code in deprecated avatar functions.

The checks for the existence of bp_core_fetch_avatar() have not
been needed since [1636], when the function was introduced.

Props xknown.
Fixes #7902.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r11938 r12177  
    193193    global $comment;
    194194
    195     if ( function_exists( 'bp_core_fetch_avatar' ) ) {
    196         echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array(
    197             'item_id' => $comment->user_id,
    198             'type'    => 'thumb',
    199             'alt'     => sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) )
    200         ) ) );
    201     } elseif ( function_exists( 'get_avatar' ) ) {
    202         get_avatar();
    203     }
     195    echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array(
     196        'item_id' => $comment->user_id,
     197        'type'    => 'thumb',
     198        'alt'     => sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) )
     199    ) ) );
    204200}
    205201
     
    212208    global $post;
    213209
    214     if ( function_exists( 'bp_core_fetch_avatar' ) ) {
    215         echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array(
    216             'item_id' => $post->post_author,
    217             'type'    => 'thumb',
    218             'alt'     => sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) )
    219         ) ) );
    220     } elseif ( function_exists( 'get_avatar' ) ) {
    221         get_avatar();
    222     }
     210    echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array(
     211        'item_id' => $post->post_author,
     212        'type'    => 'thumb',
     213        'alt'     => sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) )
     214    ) ) );
    223215}
    224216
Note: See TracChangeset for help on using the changeset viewer.