WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/profile personal options

This page is marked as incomplete. You can help Codex by expanding it.

Description

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.

Parameters

$user
(object) (optional) The WP_User object of the user being edited.
Default: None

Example

// This will show below the color scheme and above username field
add_action( 'profile_personal_options', 'extra_profile_fields' );
    
function extra_profile_fields( $user ) {
    // get the value of a single meta key
    $meta_value = get_user_meta( $user->ID, 'meta_key', true ); // $user contains WP_User Class
    // do something with it.
    ?>
    <input type="text" value="<?php echo esc_attr( $meta_value ); ?>" name="value" />
    <?php
}

Source File

The profile_personal_options hook is located in /wp-admin/user-edit.php

Related

  • show_user_profile - Hooks near the bottom of profile page (if current user)
  • edit_user_profile - Hooks near the bottom of the profile page (if not current user)
  • personal_options_update - Hooks near top of profile page after update (if current user)
  • edit_user_profile_update - Hooks near top of profile page after update (if not current user)
  • personal_options - Hooks after the "Show toolbar..." option on profile page (if current user)
  • profile_personal_options - Hooks above the "Name" section of profile page

Return to Plugin API/Action Reference