Convert User’s Avatar/Gravatar to a jpg or png on the Fly
The get_avatar function returns the Gravatar wrapped in <img> tags. In your case you’ll want to use get_avatar_url to get just the URL of the image you need. Combine that with WordPress’ wp_remote_get and you can grab the image data into a variable or save it as an image. $user = wp_get_current_user(); $gravatar_url = get_avatar_url( … Read more