WordPress.org

Make WordPress Core

Ticket #21195: 21195.16.diff

File 21195.16.diff, 1.1 KB (added by valendesigns, 6 years ago)
  • src/wp-admin/options-discussion.php

    diff --git src/wp-admin/options-discussion.php src/wp-admin/options-discussion.php
    index 18e3b3d..015ab1e 100644
    if ( empty($default) ) 
    264264$size = 32;
    265265$avatar_list = '';
    266266
    267 // Force avatars on to display these choices
    268 add_filter( 'pre_option_show_avatars', '__return_true', 100 );
    269 
    270267foreach ( $avatar_defaults as $default_key => $default_name ) {
    271268        $selected = ($default == $default_key) ? 'checked="checked" ' : '';
    272269        $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> ";
    273270
    274         $avatar = get_avatar( $user_email, $size, $default_key );
     271        $avatar = get_avatar( $user_email, $size, $default_key, '', array( 'force_default' => true, 'force_display' => true ) );
    275272        $avatar_list .= preg_replace("/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar);
    276273
    277274        $avatar_list .= ' ' . $default_name . '</label>';
    278275        $avatar_list .= '<br />';
    279276}
    280277
    281 remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
    282 
    283278/**
    284279 * Filter the HTML output of the default avatar list.
    285280 *