Use get_avatar_url() in wc_get_customer_avatar_url()

This commit is contained in:
Claudio Sanches 2017-06-09 17:17:43 -03:00
parent df0ec12fb4
commit 6d7da18d1c
1 changed files with 2 additions and 14 deletions

View File

@ -938,10 +938,7 @@ function _wc_save_product_price( $product_id, $regular_price, $sale_price = '',
}
/**
* Wrapper for @see get_avatar() which doesn't simply return
* the URL so we need to pluck it from the HTML img tag.
*
* Kudos to https://github.com/WP-API/WP-API for offering a better solution.
* Return customer avatar URL.
*
* @deprecated 3.1.0
* @since 2.6.0
@ -952,14 +949,5 @@ function wc_get_customer_avatar_url( $email ) {
// Deprecated in favor of WordPress get_avatar_url() function.
wc_deprecated_function( 'wc_get_customer_avatar_url()', '3.1', 'get_avatar_url()' );
$avatar_html = get_avatar( $email );
// Get the URL of the avatar from the provided HTML.
preg_match( '/src=["|\'](.+)[\&|"|\']/U', $avatar_html, $matches );
if ( isset( $matches[1] ) && ! empty( $matches[1] ) ) {
return esc_url_raw( $matches[1] );
}
return null;
return get_avatar_url( $email );
}