Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created October 30, 2011 00:27
Show Gist options
  • Save billerickson/1325297 to your computer and use it in GitHub Desktop.
Save billerickson/1325297 to your computer and use it in GitHub Desktop.
Set Default Avatar
<?php
/**
* Set Default Avatar
*
* @link http://www.billerickson.net/using-gravatars-in-wordpress/
* @author Bill Erickson
* @param array $avatars current default avatars
* @return array new default avatars
*
*/
function be_default_avatar( $avatars ) {
$new = get_stylesheet_directory_uri() . '/images/custom-gravatar.jpg';
$avatars[$new] = "My Custom Gravatar";
return $avatars;
}
add_filter( 'avatar_defaults', 'be_default_avatar' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment