@@ 635-646 (lines=12) @@ | ||
632 | * @param string $email the customer's email |
|
633 | * @return string the URL to the customer's avatar |
|
634 | */ |
|
635 | protected function get_avatar_url( $email ) { |
|
636 | $avatar_html = get_avatar( $email ); |
|
637 | ||
638 | // Get the URL of the avatar from the provided HTML |
|
639 | preg_match( '/src=["|\'](.+)[\&|"|\']/U', $avatar_html, $matches ); |
|
640 | ||
641 | if ( isset( $matches[1] ) && ! empty( $matches[1] ) ) { |
|
642 | return esc_url_raw( $matches[1] ); |
|
643 | } |
|
644 | ||
645 | return null; |
|
646 | } |
|
647 | ||
648 | /** |
|
649 | * Add/Update customer data. |
@@ 661-672 (lines=12) @@ | ||
658 | * @param string $email the customer's email. |
|
659 | * @return string the URL to the customer's avatar. |
|
660 | */ |
|
661 | function wc_get_customer_avatar_url( $email ) { |
|
662 | $avatar_html = get_avatar( $email ); |
|
663 | ||
664 | // Get the URL of the avatar from the provided HTML. |
|
665 | preg_match( '/src=["|\'](.+)[\&|"|\']/U', $avatar_html, $matches ); |
|
666 | ||
667 | if ( isset( $matches[1] ) && ! empty( $matches[1] ) ) { |
|
668 | return esc_url_raw( $matches[1] ); |
|
669 | } |
|
670 | ||
671 | return null; |
|
672 | } |
|
673 |