diff --git bp-activity/bp-activity-loader.php bp-activity/bp-activity-loader.php
index e0f8e4e..8298ca9 100644
|
|
|
class BP_Activity_Component extends BP_Component { |
| 308 | 308 | } else { |
| 309 | 309 | $bp->bp_options_avatar = bp_core_fetch_avatar( array( |
| 310 | 310 | 'item_id' => bp_displayed_user_id(), |
| 311 | | 'type' => 'thumb' |
| | 311 | 'type' => 'thumb', |
| | 312 | 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->displayed_user->fullname ), |
| | 313 | 'title' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->displayed_user->fullname ) |
| 312 | 314 | ) ); |
| 313 | 315 | $bp->bp_options_title = $bp->displayed_user->fullname; |
| 314 | 316 | } |
diff --git bp-activity/bp-activity-template.php bp-activity/bp-activity-template.php
index fff15d1..fb91665 100644
|
|
|
function bp_activity_avatar( $args = '' ) { |
| 898 | 898 | $type_default = bp_is_single_activity() ? 'full' : 'thumb'; |
| 899 | 899 | |
| 900 | 900 | $defaults = array( |
| 901 | | 'alt' => __( 'Profile picture of %s', 'buddypress' ), |
| | 901 | 'alt' => '', |
| 902 | 902 | 'class' => 'avatar', |
| 903 | 903 | 'email' => false, |
| 904 | 904 | 'type' => $type_default, |
| … |
… |
function bp_activity_secondary_avatar( $args = '' ) { |
| 991 | 991 | case 'groups' : |
| 992 | 992 | $object = 'group'; |
| 993 | 993 | $item_id = $activities_template->activity->item_id; |
| | 994 | $item = groups_get_group( array( 'group_id' => $item_id ) ); |
| 994 | 995 | |
| 995 | 996 | if ( empty( $alt ) ) |
| 996 | | $alt = __( 'Group logo of %s', 'buddypress' ); |
| | 997 | $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $item->name ); |
| 997 | 998 | |
| 998 | 999 | break; |
| 999 | 1000 | case 'blogs' : |
| … |
… |
function bp_activity_secondary_avatar( $args = '' ) { |
| 1009 | 1010 | $item_id = $activities_template->activity->secondary_item_id; |
| 1010 | 1011 | |
| 1011 | 1012 | if ( empty( $alt ) ) |
| 1012 | | $alt = __( 'Profile picture of %s', 'buddypress' ); |
| | 1013 | $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $item_id ) ); |
| 1013 | 1014 | |
| 1014 | 1015 | break; |
| 1015 | 1016 | default : |
| … |
… |
function bp_activity_secondary_avatar( $args = '' ) { |
| 1018 | 1019 | $email = $activities_template->activity->user_email; |
| 1019 | 1020 | |
| 1020 | 1021 | if ( !$alt ) |
| 1021 | | $alt = __( 'Profile picture of %s', 'buddypress' ); |
| | 1022 | $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $item_id ) ); |
| 1022 | 1023 | |
| 1023 | 1024 | break; |
| 1024 | 1025 | } |
diff --git bp-core/bp-core-avatars.php bp-core/bp-core-avatars.php
index f5a50f7..ea2969b 100644
|
|
|
function bp_core_fetch_avatar( $args = '' ) { |
| 146 | 146 | // Get item name for alt/title tags |
| 147 | 147 | $item_name = ''; |
| 148 | 148 | |
| | 149 | if ( !$title ) |
| | 150 | $title = $alt; |
| | 151 | |
| 149 | 152 | // Don't do this query if we don't have to |
| 150 | 153 | if ( !$alt || !$title ) { |
| 151 | 154 | if ( 'user' == $object ) |
| … |
… |
function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' |
| 598 | 601 | return !empty( $avatar ) ? $avatar : $default; |
| 599 | 602 | |
| 600 | 603 | if ( !$alt ) |
| 601 | | $alt = __( 'Avatar of %s', 'buddypress' ); |
| | 604 | $alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) ); |
| 602 | 605 | |
| 603 | 606 | // Let BuddyPress handle the fetching of the avatar |
| 604 | 607 | $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) ); |
diff --git bp-core/bp-core-classes.php bp-core/bp-core-classes.php
index bd25902..43006d4 100644
|
|
|
class BP_Core_User { |
| 169 | 169 | wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' ); |
| 170 | 170 | wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' ); |
| 171 | 171 | |
| 172 | | $this->avatar = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full' ) ); |
| 173 | | $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb' ) ); |
| 174 | | $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) ); |
| | 172 | $this->avatar = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => $this->fullname ) ); |
| | 173 | $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => $this->fullname ) ); |
| | 174 | $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => $this->fullname ) ); |
| 175 | 175 | $this->last_active = bp_core_get_last_activity( bp_get_user_meta( $this->id, 'last_activity', true ), __( 'active %s', 'buddypress' ) ); |
| 176 | 176 | } |
| 177 | 177 | |
diff --git bp-forums/bp-forums-template.php bp-forums/bp-forums-template.php
index ef39f17..2ccb550 100644
|
|
|
function bp_the_topic_poster_avatar( $args = '' ) { |
| 488 | 488 | 'type' => 'thumb', |
| 489 | 489 | 'width' => false, |
| 490 | 490 | 'height' => false, |
| 491 | | 'alt' => __( 'Profile picture of %s', 'buddypress' ) |
| | 491 | 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $forum_template->topic->topic_poster ) ) |
| 492 | 492 | ); |
| 493 | 493 | |
| 494 | 494 | $r = wp_parse_args( $args, $defaults ); |
diff --git bp-members/bp-members-template.php bp-members/bp-members-template.php
index ca10291..311224e 100644
|
|
|
function bp_member_avatar( $args = '' ) { |
| 481 | 481 | 'height' => false, |
| 482 | 482 | 'class' => 'avatar', |
| 483 | 483 | 'id' => false, |
| 484 | | 'alt' => __( 'Profile picture of %s', 'buddypress' ) |
| | 484 | 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ), |
| | 485 | 'title' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) |
| 485 | 486 | ); |
| 486 | 487 | |
| 487 | 488 | $r = wp_parse_args( $args, $defaults ); |
| 488 | 489 | extract( $r, EXTR_SKIP ); |
| 489 | 490 | |
| 490 | | return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) ); |
| | 491 | return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'title' => $title, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) ); |
| 491 | 492 | } |
| 492 | 493 | |
| 493 | 494 | function bp_member_permalink() { |
| … |
… |
function bp_loggedin_user_avatar( $args = '' ) { |
| 777 | 778 | 'width' => false, |
| 778 | 779 | 'height' => false, |
| 779 | 780 | 'html' => true, |
| 780 | | 'alt' => __( 'Profile picture of %s', 'buddypress' ) |
| | 781 | 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->loggedin_user->fullname ), |
| | 782 | 'title' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->loggedin_user->fullname ) |
| 781 | 783 | ); |
| 782 | 784 | |
| 783 | 785 | $r = wp_parse_args( $args, $defaults ); |
| 784 | 786 | extract( $r, EXTR_SKIP ); |
| 785 | 787 | |
| 786 | | return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) ); |
| | 788 | return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt, 'title' => $title ) ) ); |
| 787 | 789 | } |
| 788 | 790 | |
| 789 | 791 | function bp_displayed_user_avatar( $args = '' ) { |