I’ve successfully added custom fields to the edit-profile page:
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');
But how does one go about saving these values to a specific database table? I need to save them with the according email, in another table. I will also need to load the values back in. Any direction would be greatly appreciated.
You’ll need the following WordPress class:
Check also this other entry of the Codex:
And a blog article about Custom Tables: