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
|