get_user_to_edit

Retrieve user data and filter it.

Description

(WP_User|bool) get_user_to_edit( (int) $user_id ); 

Returns (WP_User|bool)

WP_User object on success, false on failure.

Parameters (1)

0. $user_id (int)
The user id.

Usage

  1. if ( !function_exists( 'get_user_to_edit' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/user.php'; 
  3.  
  4. // The user id. 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_user_to_edit($user_id); 
  9.  

Defined (1)

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

/wp-admin/includes/user.php  
  1. function get_user_to_edit( $user_id ) { 
  2. $user = get_userdata( $user_id ); 
  3.  
  4. if ( $user ) 
  5. $user->filter = 'edit'; 
  6.  
  7. return $user;