apply_filters( 'user_contactmethods', string[] $methods, WP_User $user )

Filters the user contact methods.


Parameters Parameters

$methods

(string[]) Array of contact method labels keyed by contact method.

$user

(WP_User) WP_User object.


Top ↑

More Information More Information

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.


Top ↑

Source Source

File: wp-includes/user.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
2.9.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by stevenlinx

    Example migrated from Codex:

    Add & remove user contact methods.

    add_filter( 'user_contactmethods', 'modify_user_contact_methods' );
    
    function modify_user_contact_methods( $methods ) {
    
    	// Add user contact methods
    	$methods['skype']   = __( 'Skype Username'   );
    	$methods['twitter'] = __( 'Twitter Username' );
    
    	// Remove user contact methods
    	unset( $methods['aim']    );
    	unset( $methods['jabber'] );
    
    	return $methods;
    }
    

You must log in before being able to contribute a note or feedback.