WordPress开发者和主题制作者的搜索引擎



wp_get_user_contact_methods ›

Since3.7.0
已弃用n/a
wp_get_user_contact_methods ( $user = null )
参数:
  • (WP_User) $user Optional. WP_User object.
    Required: No
    默认: null
返回:
  • (array) Array of contact methods and their labels.
定义在:
文档:

Set up the user contact methods.

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



源码

function wp_get_user_contact_methods( $user = null ) {
	$methods = array();
	if ( get_site_option( 'initial_db_version' ) < 23588 ) {
		$methods = array(
			'aim'    => __( 'AIM' ),
			'yim'    => __( 'Yahoo IM' ),
			'jabber' => __( 'Jabber / Google Talk' ),
		);
	}

	/**
	 * Filters the user contact methods.
	 *
	 * @since 2.9.0
	 *
	 * @param array   $methods Array of contact methods and their labels.
	 * @param WP_User $user    WP_User object.
	 */
	return apply_filters( 'user_contactmethods', $methods, $user );
}