Changeset 5455
- Timestamp:
- 12/07/2011 02:31:53 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-avatars.php
r5431 r5455 89 89 $def_type = 'thumb'; 90 90 $def_class = 'avatar'; 91 $def_alt = __( 'Avatar Image', 'buddypress' );92 91 93 92 // Set the default variables array … … 101 100 'class' => $def_class, // Custom <img> class (string) 102 101 'css_id' => false, // Custom <img> ID (string) 103 'alt' => $def_alt,// Custom <img> alt (string)102 'alt' => '', // Custom <img> alt (string) 104 103 'email' => false, // Pass the user email (for gravatar) to prevent querying the DB for it 105 104 'no_grav' => false, // If there is no avatar found, return false instead of a grav? … … 148 147 $item_name = ''; 149 148 150 if ( 'user' == $object ) 151 $item_name = bp_core_get_user_displayname( $item_id ); 152 elseif ( 'group' == $object ) 153 $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) ); 154 elseif ( 'blog' == $object ) 155 $item_name = get_blog_option( $item_id, 'blogname' ); 156 157 $alt = sprintf( $alt, apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object ) ); 149 // Don't do this query if we don't have to 150 if ( !$alt || !$title ) { 151 if ( 'user' == $object ) 152 $item_name = bp_core_get_user_displayname( $item_id ); 153 elseif ( 'group' == $object ) 154 $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) ); 155 elseif ( 'blog' == $object ) 156 $item_name = get_blog_option( $item_id, 'blogname' ); 157 } 158 159 if ( !$alt && $item_name ) { 160 $alt = sprintf( __( "Avatar Image: %s", 'buddypress' ), apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object ) ); 161 } elseif ( !$alt ) { 162 $alt = __( 'Avatar Image', 'buddypress' ); 163 } 158 164 159 165 // Set title tag -
trunk/bp-groups/bp-groups-template.php
r5431 r5455 394 394 395 395 /* Fetch the avatar from the folder, if not provide backwards compat. */ 396 if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height ) ) )396 if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'title' => $groups_template->group->name, 'alt' => $groups_template->group->name ) ) ) 397 397 $avatar = '<img src="' . esc_attr( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />'; 398 398
Note: See TracChangeset
for help on using the changeset viewer.