Codex tools: Log in
Contents |
Hooks above the "Name" section of profile page. This is typically used for adding new fields to WordPress profile pages.
This hook only triggers if a user is viewing their own profile page. There is no equivalent hook at this point for injecting content onto the profile pages of non-current users.
//This will show below the color scheme and above username fields
add_action('profile_personal_options', 'extra_profile_fields');
function extra_profile_fields($user) {
$meta = get_user_meta($user->ID, 'meta_key'); // $user contains WP_User Class
// do something with it.
// if you echo anything, remember to check if it is set. eg:
?>
<input type="text" value="<?php echo isset($meta["value"]) ? $meta["value"] : ""; ?>" name="value"/>
<?php
}
The profile_personal_options hook is located in /wp-admin/user-edit.php
Return to Plugin API/Action Reference