Skip to:
Content

BuddyPress.org

Changeset 5512


Ignore:
Timestamp:
12/11/2011 07:00:12 PM (13 years ago)
Author:
boonebgorges
Message:

Avoid PHP notices when commenting on an activity item and fetching avatar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r5477 r5512  
    898898        $type_default = bp_is_single_activity() ? 'full' : 'thumb';
    899899
     900        if ( !empty( $activities_template->activity->display_name ) ) {
     901            $dn_default = $activities_template->activity->display_name;
     902        } else if ( !empty( $activities_template->current_comment->display_name ) ) {
     903            $dn_default = $activities_template->current_comment->display_name;
     904        }
     905       
     906        $alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' );
     907       
    900908        $defaults = array(
    901             'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ),
     909            'alt'     => $alt_default,
    902910            'class'   => 'avatar',
    903911            'email'   => false,
Note: See TracChangeset for help on using the changeset viewer.