钩子文档

do_robotstxt

💡 云策文档标注

概述

do_robotstxt 是一个 WordPress 动作钩子,在显示 robots.txt 文件时触发,允许开发者自定义 robots.txt 内容。

关键要点

  • do_robotstxt 是一个动作钩子,用于在 robots.txt 文件显示时执行自定义代码。
  • 此钩子自 WordPress 2.1.0 版本引入,可用于修改或添加 robots.txt 内容。
  • 相关函数 do_robots() 负责显示默认的 robots.txt 文件内容。

📄 原文内容

Fires when displaying the robots.txt file.

Source

do_action( 'do_robotstxt' );

Changelog

Version Description
2.1.0 Introduced.