get_user_to_edit example

if ( ! is_wp_error( $errors ) ) {
            $redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) );
            if ( $wp_http_referer ) {
                $redirect = add_query_arg( 'wp_http_referer', urlencode( $wp_http_referer )$redirect );
            }
            wp_redirect( $redirect );
            exit;
        }

        // Intentional fall-through to display $errors.     default:
        $profile_user = get_user_to_edit( $user_id );

        if ( ! current_user_can( 'edit_user', $user_id ) ) {
            wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
        }

        $title    = sprintf( $title$profile_user->display_name );
        $sessions = WP_Session_Tokens::get_instance( $profile_user->ID );

        require_once ABSPATH . 'wp-admin/admin-header.php';
        ?>
Home | Imprint | This part of the site doesn't use cookies.