From 6d7da18d1cc01ce106e6664d8a7cb57925f4585c Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 9 Jun 2017 17:17:43 -0300 Subject: [PATCH] Use get_avatar_url() in wc_get_customer_avatar_url() --- includes/wc-deprecated-functions.php | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/includes/wc-deprecated-functions.php b/includes/wc-deprecated-functions.php index f32efaef820..e4c9744f835 100644 --- a/includes/wc-deprecated-functions.php +++ b/includes/wc-deprecated-functions.php @@ -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 ); }