Changeset 5455 for trunk/bp-core/bp-core-avatars.php
- Timestamp:
- 12/07/2011 02:31:53 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-avatars.php (modified) (3 diffs)
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
Note: See TracChangeset
for help on using the changeset viewer.