通过多说服务器缓存加速Gravatar 头像
将下面的代码丢入WordPress 主题下的functions.php 文件(代码来自于 麦田一根葱 ,感谢原作者):
1 2 3 4 5 |
function mytheme_get_avatar($avatar) { $avatar = str_replace(array("www.gravatar.com","0.gravatar.com","1.gravatar.com","2.gravatar.com"),"gravatar.duoshuo.com",$avatar); return $avatar; } add_filter( ‘get_avatar‘, ‘mytheme_get_avatar‘, 10, 3 ); |
时间: 2024-11-03 13:13:21