get_headers(); if ( empty( $headers[ self::HEADER ] ) ) { return $served; } $body = $result->get_data(); if ( ! is_string( $body ) ) { return $served; } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- a generated file (CSV, PDF), sent with its own Content-Type and nosniff. Escaping it for HTML would corrupt the very bytes this path exists to deliver. echo $body; return true; } }