WordPress.org

Make WordPress Core

Changeset 9076


Ignore:
Timestamp:
10/03/2008 03:20:54 AM (10 years ago)
Author:
ryan
Message:

Avatar alt fixes from nbachiyski. fixes #7536

File:
1 edited

Legend:

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

    r9075 r9076  
    14551455 * @param int $size Size of the avatar image
    14561456 * @param string $default URL to a default image to use if no avatar is available
    1457  * @param string $alt Alternate text to use in image tag
     1457 * @param string $alt Alternate text to use in image tag, the default is Avatar
    14581458 * @return string <img> tag for the user's avatar
    14591459*/
    1460 function get_avatar( $id_or_email, $size = '96', $default = '', $alt = 'Avatar' ) {
     1460function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
    14611461    if ( ! get_option('show_avatars') )
    14621462        return false;
     1463
     1464    if ( false === $alt)
     1465        $alt = __( 'Avatar' );
     1466
     1467    $safe_alt = attribute_escape( $alt );
    14631468
    14641469    if ( !is_numeric($size) )
     
    15181523            $out .= "&amp;r={$rating}";
    15191524
    1520         $avatar = "<img alt='{$alt}' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />";
     1525        $avatar = "<img alt='{$safe_alt}' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />";
    15211526    } else {
    1522         $avatar = "<img alt='{$alt}' src='{$default}' class='avatar avatar-{$size} avatar-default' height='{$size}' width='{$size}' />";
     1527        $avatar = "<img alt='{$safe_alt}' src='{$default}' class='avatar avatar-{$size} avatar-default' height='{$size}' width='{$size}' />";
    15231528    }
    15241529
Note: See TracChangeset for help on using the changeset viewer.