Continue reading " /> [WP2.9 之变] 自定义用户联系方式 — acExtend

[WP2.9 之变] 自定义用户联系方式

如果觉得 WordPress 默认的用户联系方式太少,或者有自己不需要的,在 WordPress 2.9 中可以进行自定义,下面是一个示例。

示例:删除 YIM,增加 Twitter(via


function add_twitter_contactmethod($contactmethods){
// Add Twitter
$contactmethods['twitter'] = ‘Twitter’;

// Remove Yahoo IM
unset($contactmethods['yim']);

return $contactmethods;
}
add_filter(‘user_contactmethods’,'add_twitter_contactmethod’,10,1);

调用新添加的联系方式

调用新添加的联系方式将使用 WordPress 2.8 中新添加的新模板标签 the_author_meta,使用方法参照前文。上例的调用代码如下。



以上,Andor,2009年9月30日,惠州。

This entry was posted in 一般内容 and tagged . Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Your email is never published nor shared. Required fields are marked *

*

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>