Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save BrianHenryIE/754f75c1f79d721a0f2721c9f20a7779 to your computer and use it in GitHub Desktop.
Save BrianHenryIE/754f75c1f79d721a0f2721c9f20a7779 to your computer and use it in GitHub Desktop.
diff --git a/includes/class-wp-user-avatar-functions.php b/includes/class-wp-user-avatar-functions.php
index 2a89f4d..fd694e1 100644
--- a/includes/class-wp-user-avatar-functions.php
+++ b/includes/class-wp-user-avatar-functions.php
@@ -409,7 +409,8 @@ class WP_User_Avatar_Functions {
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;
@@ -423,7 +424,8 @@ class WP_User_Avatar_Functions {
}
} 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;
@maxunet03
Copy link

hi, how can i use .diff file? Should I upload as a plug-in? Anyone help?

Thanks!

@vir2lboy
Copy link

Thank you, wish the plugin owner would implement that fix in future releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment