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/Filter Reference/user contactmethods

Description

Customize the contact information fields available to your WordPress users. Edits the available contact methods on a user's profile page. Contact methods can be both added and removed.

Parameters

  • array $user_contact an associative array keyed by form field ids with human-readable text as values.
  • WP_User $user (since 3.1) WP_User object.

Examples

function modify_user_contact_methods( $user_contact ) {

	// Add user contact methods
	$user_contact['skype']   = __( 'Skype Username'   );
	$user_contact['twitter'] = __( 'Twitter Username' );

	// Remove user contact methods
	unset( $user_contact['aim']    );
	unset( $user_contact['jabber'] );

	return $user_contact;
}
add_filter( 'user_contactmethods', 'modify_user_contact_methods' );

Resources

Related

See also index of Function Reference and index of Template Tags.