Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

rest_ensure_response()

3 tags 1 category

rest_ensure_response() — Ensures a REST response is a response object (for consistency). This implements WP_REST_Response, allowing usage of set_status/header/etc without needing to double-check the object. Will also allow WP_Error to indicate error responses, so users should immediately check for this value.

Inputs: $response (WP_REST_Response|WP_Error|WP_HTTP_Response|mixed): Response to check.

Returns WP_REST_Response|WP_Error: If response generated an error, WP_Error, if response is already an instance, WP_REST_Response, otherwise returns a new WP_REST_Response instance.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…