if ( $response instanceof WP_REST_Response
) { return $response;
} /*
* While WP_HTTP_Response is the base class of WP_REST_Response, it doesn't provide
* all the required methods used in WP_REST_Server::dispatch().
*/
if ( $response instanceof WP_HTTP_Response
) { return new WP_REST_Response( $response->
get_data(),
$response->
get_status(),
$response->
get_headers() );
} return new WP_REST_Response( $response );
}/**
* Handles _deprecated_function() errors.
*
* @since 4.4.0
*
* @param string $function_name The function that was called.
* @param string $replacement The function that should have been called.
* @param string $version Version.
*/