I have a client that has 5 different gravatar images, and would like them to be randomly used as the thumbnail for people's comments that have no Gravatar. I know how to change the Gravatar to a custom one, but not display one of the five in the set randomly each time. I know it can be done, because Automattic does it, but I don't now where I could get a look at that code.
Does someone smarter than I know how this may be done?
//* Create a custom Gravatar
add_filter( 'avatar_defaults', 'sp_custom_gravatar' );
function sp_custom_gravatar ($avatar) {
$custom_avatar = get_stylesheet_directory_uri() . '/images/gravatar.png';
$avatar[$custom_avatar] = "Custom Gravatar";
return $avatar;
}