我已成功将自定义字段添加到编辑配置文件页面:
function directoryFields() { ?>
<h3>Directory Info</h3>
<table class="form-table">
<tr>
<th><label for="responsibilities">Primary work responsibilities</label></th>
<td><textarea name="responsibilities" id="responsibilities" rows="5" cols="30">Load info here...</textarea><br />
</tr>
<tr>
<th><label for="ask">Ask me about</label></th>
<td><textarea name="ask" id="ask" rows="5" cols="30">Load info here...</textarea><br />
</tr>
<tr>
<th><label for="ask">Memberships and Affiliations</label></th>
<td><textarea name="memberships" id="memberships" rows="5" cols="30">Load info here...</textarea><br />
</tr>
<tr>
<th><label for="ask">Education</label></th>
<td><textarea name="education" id="education" rows="5" cols="30">Load info here...</textarea><br />
</tr>
</table>
<?php }
add_action('show_user_profile', 'directoryFields');
但是如何将这些值保存到特定的数据库表中呢?我需要将它们与相应的电子邮件一起保存在另一个表中。我还需要重新加载这些值。任何方向都将不胜感激。