Open the file
/wp-content/plugins/wp-user-avatar/includes/class-wp-user-avatar-functions.php
Then look for the function
public function wpua_get_avatar_original($id_or_email=””, $size=””, $default=””, $alt=””)
and exchange the code with this:
public function wpua_get_avatar_original($id_or_email="", $size="", $default="", $alt="") {
global $avatar_default, $mustache_avatar, $wpua_avatar_default, $wpua_disable_gravatar, $wpua_functions;
// Remove get_avatar filter
remove_filter('get_avatar', array($wpua_functions, 'wpua_get_avatar_filter'));
if((bool) $wpua_disable_gravatar != 1) {
// User doesn't have Gravatar and Default Avatar is wp_user_avatar, show custom Default Avatar
if(!$wpua_functions->wpua_has_gravatar($id_or_email) && $avatar_default == 'wp_user_avatar') {
// Show custom Default Avatar
if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
// $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
$size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );
$wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, $size_numeric_w_x_h);
$default = $wpua_avatar_default_image[0];
} else {
$default = $mustache_avatar;
}
} else {
// Get image from Gravatar, whether it's the user's image or default image
$wpua_image = get_avatar($id_or_email, $size);
// Takes the img tag, extracts the src
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $wpua_image, $matches, PREG_SET_ORDER);
$default = !empty($matches) ? $matches [0] [1] : "";
}
} else {
if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
// $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
$size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );
$wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, $size_numeric_w_x_h);
$default = $wpua_avatar_default_image[0];
} else {
$default = $mustache_avatar;
}
}
// Enable get_avatar filter
add_filter('get_avatar', array($wpua_functions, 'wpua_get_avatar_filter'), 10, 5);
/**
* Filter original avatar src
* @since 1.9
* @param string $default
*/
return apply_filters('wpua_get_avatar_original', $default);
}