wp_get_user_contact_methods()
Sets up the user contact methods.
Default contact methods were removed for new installations in WordPress 3.6 and completely removed from the codebase in WordPress 6.9.
Use the user_contactmethods filter to add or remove contact methods.
Hooks from the function
Returns
String[]. Array of contact method labels keyed by contact method.
Usage
wp_get_user_contact_methods( $user );
- $user(WP_User|null)
- WP_User object.
Default:null
Changelog
| Since 3.7.0 | Introduced. |
| Since 6.9.0 | Removed references to aim, jabber, and yim contact methods. |
wp_get_user_contact_methods() wp get user contact methods code WP 6.9.1
function wp_get_user_contact_methods( $user = null ) {
$methods = array();
/**
* Filters the user contact methods.
*
* @since 2.9.0
*
* @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 apply_filters( 'user_contactmethods', $methods, $user );
}