get_user_to_edit() WordPress Function

This function allows you to get the user to edit. You can either use the ID or the username.

get_user_to_edit( int $user_id ) #

Retrieve user data and filter it.


Parameters

$user_id

(int)(Required)User ID.


Top ↑

Return

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


Top ↑

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;
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.5Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.