wp_get_user_contact_methods

Set up the user contact methods.

Description

(array) wp_get_user_contact_methods( (null) $user = null ); 

Default contact methods were removed in 3.6. A filter dictates contact methods.

Returns (array)

Array of contact methods and their labels.

Parameters (1)

0. $user — Optional. (null) => null
WP_User object.

Usage

  1. if ( !function_exists( 'wp_get_user_contact_methods' ) ) { 
  2. require_once ABSPATH . WPINC . '/user.php'; 
  3.  
  4. // Optional. WP_User object. 
  5. $user = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_get_user_contact_methods($user); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/user.php  
  1. function wp_get_user_contact_methods( $user = null ) { 
  2. $methods = array(); 
  3. if ( get_site_option( 'initial_db_version' ) < 23588 ) { 
  4. $methods = array( 
  5. 'aim' => __( 'AIM' ),  
  6. 'yim' => __( 'Yahoo IM' ),  
  7. 'jabber' => __( 'Jabber / Google Talk' ) 
  8. ); 
  9.  
  10. /** 
  11. * Filters the user contact methods. 
  12. * @since 2.9.0 
  13. * @param array $methods Array of contact methods and their labels. 
  14. * @param WP_User $user WP_User object. 
  15. */ 
  16. return apply_filters( 'user_contactmethods', $methods, $user );