add_action('init', function() { if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/markdown') !== false) { $llms_file = ABSPATH . 'llms.txt'; if (file_exists($llms_file)) { $markdown_content = file_get_contents($llms_file); // Set required headers for IsItAgentReady header('Content-Type: text/markdown; charset=utf-8'); // Calculate and send approximate token count header if possible $token_estimate = ceil(strlen($markdown_content) / 4); header('X-Markdown-Tokens: ' . $token_estimate); echo $markdown_content; exit; } } });