} } $request->
set_param( 'context', 'edit'
);
$previous =
$this->
prepare_item_for_response( $user,
$request );
// Include user admin functions to get access to wp_delete_user().
require_once ABSPATH . 'wp-admin/includes/user.php';
$result =
wp_delete_user( $id,
$reassign );
if ( !
$result ) { return new WP_Error( 'rest_cannot_delete',
__( 'The user cannot be deleted.'
),
array
( 'status' => 500
) );
} $response =
new WP_REST_Response();
$response->
set_data(