$data Response body. * * @return WP_REST_Response The response. */ public static function created( array $data ): WP_REST_Response { return new WP_REST_Response( $data, 201 ); } /** * Answering with a bare string body. * * @param string $text Body, sent as a JSON string. * @param int $status HTTP status code. * * @return WP_REST_Response The response. */ public static function text( string $text, int $status ): WP_REST_Response { return new WP_REST_Response( $text, $status ); } /** * Answering with a { message } object. * * @param string $message Human-readable message. * @param int $status HTTP status code. * * @return WP_REST_Response The response. */ public static function message( string $message, int $status ): WP_REST_Response { return new WP_REST_Response( array( 'message' => $message ), $status ); } }