WordPress.org

Make WordPress Core

Changeset 8661


Ignore:
Timestamp:
08/17/2008 11:23:49 AM (10 years ago)
Author:
westi
Message:

alt attibutes for get_avatar(). Fixes #7523 props Speedboxer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r8600 r8661  
    13451345 * @param int $size Size of the avatar image
    13461346 * @param string $default URL to a default image to use if no avatar is available
     1347 * @param string $alt Alternate text to use in image tag
    13471348 * @return string <img> tag for the user's avatar
    13481349*/
    1349 function get_avatar( $id_or_email, $size = '96', $default = '' ) {
     1350function get_avatar( $id_or_email, $size = '96', $default = '', $alt = 'Avatar' ) {
    13501351    if ( ! get_option('show_avatars') )
    13511352        return false;
     
    14041405            $out .= "&amp;r={$rating}";
    14051406
    1406         $avatar = "<img alt='' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />";
     1407        $avatar = "<img alt='{$alt}' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />";
    14071408    } else {
    1408         $avatar = "<img alt='' src='{$default}' class='avatar avatar-{$size} avatar-default' height='{$size}' width='{$size}' />";
    1409     }
    1410 
    1411     return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default);
     1409        $avatar = "<img alt='{$alt}' src='{$default}' class='avatar avatar-{$size} avatar-default' height='{$size}' width='{$size}' />";
     1410    }
     1411
     1412    return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default, $alt);
    14121413}
    14131414endif;
Note: See TracChangeset for help on using the changeset viewer.