W3cubDocs

/WordPress

get_user_to_edit( int $user_id )

Retrieve user data and filter it.

Parameters

$user_id

(int) (Required) User ID.

Return

(WP_User|bool) WP_User object on success, false on failure.

Source

File: wp-admin/includes/user.php

function get_user_to_edit( $user_id ) {
	$user = get_userdata( $user_id );

	if ( $user ) {
		$user->filter = 'edit';
	}

	return $user;
}

Changelog

Version Description
2.0.5 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_user_to_edit