Is there an equivalent to WP_Error object I can return in the case of a successful REST request?

In the case of an error at a REST endpoint I’ve set up, I am accustomed to returning a WP_Error object, which is convenient because I can include a code, a message, and an HTTP status into a single returned object.

But what about in the case of success? Is there an equivalent class, for the sake of control and uniformity?

Read more here:: Is there an equivalent to WP_Error object I can return in the case of a successful REST request?

Leave a Reply

Your email address will not be published. Required fields are marked *