黄聪:wordpress如何使用get_avatar禁止调用gravatar头像,替换为自定义头像
add_filter( 'get_avatar' , 'my_custom_avatar' , 1 , 5 );
function my_custom_avatar( $avatar, $id_or_email, $size, $default, $alt) { if ( ! empty( $id_or_email->user_id ) ) {
$avatar = "http://static.cnblogs.com/images/logo_small.gif";
}else{
$avatar = "http://static.cnblogs.com/images/logo_small.gif";
}
$avatar = "<img alt='{$alt}' src='{$avatar}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />"; return $avatar;
}
黄聪:wordpress如何使用get_avatar禁止调用gravatar头像,替换为自定义头像的更多相关文章
- 黄聪:《跟黄聪学WordPress插件开发》
续<跟黄聪学WordPress主题开发>之后,又一个作品完成!<跟黄聪学Wordpress插件开发>,国内最好的Wordpress插件开发视频教程!! 目录预览: WordPr ...
- 黄聪:《跟黄聪学WordPress主题开发》
又一个作品完成!<跟黄聪学Wordpress主题开发>,国内最好的Wordpress主题模版开发视频教程!! 目录预览: WordPress官方源文件层式结构讲解 WordPress数据库 ...
- 黄聪:wordpress教程
又一个作品完成!<跟黄聪学Wordpress主题开发>,国内最好的Wordpress主题模版开发视频教程!! 目录预览: WordPress官方源文件层式结构讲解 WordPress数据库 ...
- 黄聪:如何使用CodeSmith批量生成代码(转:http://www.cnblogs.com/huangcong/archive/2010/06/14/1758201.html)
先看看CodeSmith的工作原理: 简单的说:CodeSmith首先会去数据库获取数据库的结构,如各个表的名称,表的字段,表间的关系等等,之后再根据用户自定义好的模板文件,用数据库结构中的关键字替代 ...
- 黄聪:Microsoft Enterprise Library 5.0 系列教程(六) Security Application Block
原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(六) Security Application Block 开发人员经常编写需要安全功能的应用程序.这些应用程序 ...
- 黄聪:Microsoft Enterprise Library 5.0 系列教程(七) Exception Handling Application Block
原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(七) Exception Handling Application Block 使用企业库异常处理应用程序模块的 ...
- 黄聪:Microsoft Enterprise Library 5.0 系列教程(四) Logging Application Block
原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(四) Logging Application Block 企业库日志应用程序模块工作原理图: 从上图我们可以 ...
- 黄聪:Microsoft Enterprise Library 5.0 系列教程(十) Configuration Application Block
原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(十) Configuration Application Block 到目前为止,我们使用的模块都是在同一个配置 ...
- 黄聪:Microsoft Enterprise Library 5.0 系列教程(九) Policy Injection Application Block
原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(九) Policy Injection Application Block 代理对象(Proxy Object) ...
随机推荐
- 作业6 NABCD模型分析,产品Backlog
1.N(Need 需求): 随着生活水平的提高,每个家庭中都会有电脑和移动设备,可以更加快捷方便使用软件.以前孩子练习计算能力需要通做习题卷或老师出题目来进行,但现在只要通过这个四则运算的程序,可以自 ...
- ubuntu14.04 and ros indigo install kinect driver--16
摘要: 原创博客:转载请表明出处:http://www.cnblogs.com/zxouxuewei/ 今日多次测设ros indigo install kinect driver ,提示各种失败,然 ...
- php部分--例子:租房子(复选框的全选、数组拼接成字符串、设置复选框的name值、)
1.链接数据库 <?php include("DBDA.class.php"); $db=new DBDA(); $sql="select * from fangz ...
- Java动物声音模拟器
abstract class Animal{ abstract void cry(); abstract String getAnimalName(); } class Simulator{ void ...
- timus 1136 Parliament(二叉树)
Parliament Time limit: 1.0 secondMemory limit: 64 MB A new parliament is elected in the state of MMM ...
- Nanopore sensors for nucleic acid analysis 论文阅读笔记
Nanopore sensors for nucleic acid analysis Bala Murali Venkatesan and Rashid Bashir 用于核酸分析的纳米孔传感器 纳米 ...
- android读取远程图片案例
关键代码:Bitmap bitmap=BitmapFactory.decodeByteArray(data, 0, data.length);imageview.setImageBitmap(bitm ...
- Don’t Assume – Per Session Buffers
MySQL has a number of global buffers, i.e. your SGA. There are also a number of per session/thread b ...
- js button onclick动作赋值操作
昨天遇到的小问题 记录下 主要的东西其实都在这里:http://www.jb51.net/article/35107.htm 我稍微写一下: <script> function show( ...
- css @语法,@规则 @import @charset @font-face @fontdef @media @page
CSS At-Rules Reference 样式表规则 At-Rules 样式表规则 CSS Version 版本 Compatibility 兼容性 Description 简介 @impo ...