wordpress自定义用户个人资料

在进行网站制作的过程中,我们需要自定义用户的个人资料,因为wordperss常见的资料是国外习惯,比如国内的QQ,微信都是没有的,那么就需要我们自己搞了,说一个非常方便常用的办法,我们可以使用过滤器custom_contactmethods:

 

/*
Plugin Name: Custom Contact
Plugin URI: https://52gys.cn/
Description: 自定义博客的联系方式,从 WordPress 默认的 AIM, Yahoo IM 改为中国常见的 QQ, MSN 和飞信。
Version: 1.0
Author: Neekey
Author URI: https://52gys.cn/
*/

add_filter('user_contactmethods','custom_contactmethods');
function custom_contactmethods($user_contactmethods ){
    $user_contactmethods  = array(
        'qq' => 'QQ',
        'msn' => 'MSN',
        'jabber' => __('Jabber / Google Talk'),
        'fetion' => '飞信'
    );
    return $user_contactmethods ;
}

创建一个php文件 然后运行如上代码就可以制作一个叫做custom Contact的插件,然后启用插件就可以了,当然了你也可以在主题的function中直接调用。

0

评论0

请先
显示验证码
没有账号?注册  忘记密码?