WordPress custom user contact information input box

Source: Internet
Author: User

The user's personal data contact information includes email, site, AIM, Yahoo and Jabber by default. We may have never heard of anything, so it is necessary to remove it. This article will teach you how to customize the items of this information.

The following code deletes AIM, Yahoo and Jabber, and adds Sina Weibo, Tencent Weibo, and QQ, which are commonly used social networks in China.

The code is as follows: Copy code

Function Bing_change_user_contact_information ($ fields ){
Unset ($ fields ['aim ']);
Unset ($ fields ['yim ']);
Unset ($ fields ['jabber ']);
$ Fields ['Weibo '] = 'sina weibo ';
$ Fields ['t _ weibo '] = 'Tencent weibo ';
$ Fields ['QQ'] = 'Tencent QQ ';
Return $ fields;
}
Add_filter ('User _ contactmethods ', 'Bing _ change_user_contact_information ');


To obtain this information, you only need to use the get_the_author_meta () function.

The code is as follows: Copy code


$ Weibo = get_the_author_meta ('Weibo ', $ user_id); // Sina weibo
$ T_weibo = get_the_author_meta ('t_ weibo ', $ user_id); // Tencent weibo
$ Qq = get_the_author_meta ('QQ', $ user_id); // Tencent qq

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.