Changeset 5466 for trunk/bp-core/bp-core-avatars.php
- Timestamp:
- 12/09/2011 01:17:57 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-avatars.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-avatars.php
r5455 r5466 146 146 // Get item name for alt/title tags 147 147 $item_name = ''; 148 149 // Don't do this query if we don't have to 150 if ( !$alt || !$title ) { 148 149 // Backpat for the 'alt' parameter, which used to encourage sprintf()-style values 150 if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) { 151 var_dump( 'yes' ); 151 152 if ( 'user' == $object ) 152 153 $item_name = bp_core_get_user_displayname( $item_id ); … … 155 156 elseif ( 'blog' == $object ) 156 157 $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 ) { 158 159 $alt = sprintf( $alt, apply_filters( 'bp_core_avatar_alt', $item_name, $item_id, $object ) ); 160 } 161 162 // Get a fallback for the 'alt' parameter 163 if ( !$alt ) { 162 164 $alt = __( 'Avatar Image', 'buddypress' ); 163 165 } 164 166 165 // Set title tag 167 // Set title tag, if it's been provided 166 168 if ( $title ) 167 169 $title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object ) ) . "'"; 168 elseif ( $item_name )169 $title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $item_name, $item_id, $object ) ) . "'";170 170 171 171 // Set CSS ID if passed
Note: See TracChangeset
for help on using the changeset viewer.