Make WordPress Core

Ticket #31469: miqro-31469.diff

File miqro-31469.diff, 2.5 KB (added by miqrogroove, 10 years ago)

Adds height and width args.

  • src/wp-includes/link-template.php

     
    34223422 * @param array $args        {
    34233423 *     Optional. Arguments to return instead of the default arguments.
    34243424 *
    3425  *     @type int    $size           Height and width of the avatar in pixels. Default 96.
     3425 *     @type int    $size           Height and width of the avatar image file in pixels. Default 96.
     3426 *     @type int    $height         Display height of the avatar in pixels. Default 96.
     3427 *     @type int    $width          Display width of the avatar in pixels. Default 96.
    34263428 *     @type string $default        URL for the default image or a default type. Accepts '404' (return
    34273429 *                                  a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster),
    34283430 *                                  'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm',
     
    34493451function get_avatar_data( $id_or_email, $args = null ) {
    34503452        $args = wp_parse_args( $args, array(
    34513453                'size'           => 96,
     3454                'height'         => 96,
     3455                'width'          => 96,
    34523456                'default'        => get_option( 'avatar_default', 'mystery' ),
    34533457                'force_default'  => false,
    34543458                'rating'         => get_option( 'avatar_rating' ),
     
    34653469                $args['size'] = 96;
    34663470        }
    34673471
     3472        if ( is_numeric( $args['height'] ) ) {
     3473                $args['height'] = absint( $args['height'] );
     3474                if ( ! $args['height'] ) {
     3475                        $args['height'] = 96;
     3476                }
     3477        } else {
     3478                $args['height'] = 96;
     3479        }
     3480
     3481        if ( is_numeric( $args['width'] ) ) {
     3482                $args['width'] = absint( $args['width'] );
     3483                if ( ! $args['width'] ) {
     3484                        $args['width'] = 96;
     3485                }
     3486        } else {
     3487                $args['width'] = 96;
     3488        }
     3489
    34683490        if ( empty( $args['default'] ) ) {
    34693491                $args['default'] = get_option( 'avatar_default', 'mystery' );
    34703492        }
  • src/wp-includes/pluggable.php

     
    21432143        }
    21442144
    21452145        $args['size']    = $size;
     2146        $args['width']   = $size;
     2147        $args['height']  = $size;
    21462148        $args['default'] = $default;
    21472149        $args['alt']     = $alt;
    21482150
     
    21972199                esc_attr( $args['alt'] ),
    21982200                esc_url( $url ),
    21992201                esc_attr( join( ' ', $class ) ),
    2200                 (int) $args['size'],
    2201                 (int) $args['size']
     2202                (int) $args['height'],
     2203                (int) $args['width']
    22022204        );
    22032205
    22042206        /**