rest_authorization_required_code() ) ); }; } /** * Build a response that must never be cached. * * @param mixed $data Payload. * @param int $status HTTP status. */ protected function respond( mixed $data, int $status = 200 ): WP_REST_Response { $response = new WP_REST_Response( $data, $status ); $response->header( 'Cache-Control', 'no-store, private' ); return $response; } }