wp_xmlrpc_server8b7c:f320:99b9:690f:4595:cd17:293a:c069_prepare_user( WP_User $user, array $fields ): array  Prepares user data for return in an XML-RPC object.   Parameters   $user WP_User Required    The unprepared user object.    $fields array Required    The subset of user fields to return.      Return array The prepared user data.   Source  File: wp-includes/class-wp-xmlrpc-server.php. View all references  protected function _prepare_user( $user, $fields ) {
	$_user = array( 'user_id' => (string) $user->ID );

	$user_fields = array(
		'username'     => $user->user_login,
		'first_name'   => $user->user_firstname,
		'last_name'    => $user->user_lastname,
		'registered'   => $this->_convert_date( $user->user_registered ),
		'bio'          => $user->user_description,
		'email'        => $user->user_email,
		'nickname'     => $user->nickname,
		'nicename'     => $user->user_nicename,
		'url'          => $user->user_url,
		'display_name' => $user->display_name,
		'roles'        => $user->roles,
	);

	if ( in_array( 'all', $fields, true ) ) {
		$_user = array_merge( $_user, $user_fields );
	} else {
		if ( in_array( 'basic', $fields, true ) ) {
			$basic_fields = array( 'username', 'email', 'registered', 'display_name', 'nicename' );
			$fields       = array_merge( $fields, $basic_fields );
		}
		$requested_fields = array_intersect_key( $user_fields, array_flip( $fields ) );
		$_user            = array_merge( $_user, $requested_fields );
	}

	/**
	 * Filters XML-RPC-prepared data for the given user.
	 *
	 * @since 3.5.0
	 *
	 * @param array   $_user  An array of user data.
	 * @param WP_User $user   User object.
	 * @param array   $fields An array of user fields.
	 */
	return apply_filters( 'xmlrpc_prepare_user', $_user, $user, $fields );
}
   Hooks     apply_filters( 'xmlrpc_prepare_user', array $_user, WP_User $user, array $fields )   
Filters XML-RPC-prepared data for the given user.      Related  Uses    Uses Description      wp_xmlrpc_server8b7c:f320:99b9:690f:4595:cd17:293a:c069_convert_date() wp-includes/class-wp-xmlrpc-server.php   Convert a WordPress date string to an IXR_Date object.     apply_filters() wp-includes/plugin.php   Calls the callback functions that have been added to a filter hook.   
   Used By    Used By Description      wp_xmlrpc_server8b7c:f320:99b9:690f:4595:cd17:293a:c069wp_getUser() wp-includes/class-wp-xmlrpc-server.php   Retrieve a user.     wp_xmlrpc_server8b7c:f320:99b9:690f:4595:cd17:293a:c069wp_getUsers() wp-includes/class-wp-xmlrpc-server.php   Retrieve users.     wp_xmlrpc_server8b7c:f320:99b9:690f:4595:cd17:293a:c069wp_getProfile() wp-includes/class-wp-xmlrpc-server.php   Retrieve information about the requesting user.   
  

    
{'path': 'public/docs/wordpress/classes/wp_xmlrpc_server/_prepare_user.html', 'source': 'DevDocs.IO'}