/**
*添加自定义表单
*https://www.weixiaoduo.com/remove-post-type-support/
*/
functionBing_add_extra_social_links($user){
?>
<h3> 自定义的表单</h3>
<table class="form-table">
<tr>
<th><label for="weibo"> 新浪微博</label></th>
<td><input type="text"name="weibo"value="<?phpechoesc_attr(get_the_author_meta('weibo',$user->ID));?>"class="regular-text"/></td>
</tr>
<tr>
<th><label for="t_weibo"> 腾讯微博</label></th>
<td><input type="text"name="t_weibo"value="<?phpechoesc_attr(get_the_author_meta('t_weibo',$user->ID));?>"class="regular-text"/></td>
</tr>
<tr>
<th><label for="qq">QQ 号码</label></th>
<td>
<input type="text"name="qq"value="<?phpechoesc_attr(get_the_author_meta('qq',$user->ID));?>"class="regular-text"/>
<br>
<span class="description"for="qq"> 请输入您的 QQ 号码。</span>
</td>
</tr>
</table>
<?php
}
add_action('show_user_profile','Bing_add_extra_social_links');
add_action('edit_user_profile','Bing_add_extra_social_links');
/**
*保存自定义表单
*https://www.weixiaoduo.com/remove-post-type-support/
*/
functionBing_save_extra_social_links($user_id){
update_user_meta($user_id,'weibo',sanitize_text_field($_POST['weibo']));
update_user_meta($user_id,'t_weibo',sanitize_text_field($_POST['t_weibo']));
update_user_meta($user_id,'qq',sanitize_text_field($_POST['qq']));
}
add_action('personal_options_update','Bing_save_extra_social_links');
add_action
('edit_user_profile_update','Bing_save_extra_social_links');