user_contactmethods filter-hookWP 2.9.0

Filters the user contact methods.

Usage

add_filter( 'user_contactmethods', 'wp_kama_user_contactmethods_filter', 10, 2 );

/**
 * Function for `user_contactmethods` filter-hook.
 * 
 * @param string[]     $methods Array of contact method labels keyed by contact method.
 * @param WP_User|null $user    WP_User object or null if none was provided.
 *
 * @return string[]
 */
function wp_kama_user_contactmethods_filter( $methods, $user ){

	// filter...
	return $methods;
}
$methods(string[])
Array of contact method labels keyed by contact method.
$user(WP_User|null)
WP_User object or null if none was provided.

Changelog

Since 2.9.0 Introduced.

Where the hook is called

wp_get_user_contact_methods()
user_contactmethods
wp-includes/user.php 2839
return apply_filters( 'user_contactmethods', $methods, $user );

Where the hook is used in WordPress

Usage not found.