主题开发文档

💡 云策文档标注

概述

本文档强调了为WordPress主题编写文档的重要性,包括面向最终用户和开发者的文档要求,并提供了readme.txt文件的具体规范。

关键要点

  • 主题文档需包含最终用户的设计限制或特殊安装/设置说明。
  • 主题必须包含readme.txt文件,遵循插件目录的Markdown格式,自2018年10月25日起新主题需遵守此规则,旧主题有6个月宽限期。
  • 自WordPress 5.8起,主题readme文件不再解析要求,Requires PHP和Requires at least等头部信息需从style.css文件中解析。

📄 原文内容

Documentation is important for themes as it provides a way for users to understand what a theme does and does not support. Likewise, documenting the code of your theme will make it easier for other theme developers to customize your theme, likely with a child theme.

Here’s a list of requirements and recommendations for your theme’s documentation.

  • Themes are required to provide end-user documentation of any design limitations or extraordinary installation/setup instructions.
  • Themes are required to include a readme.txt file, using the plugin directory’s readme.txt markdown format. New themes need to follow this rule as of October 25th, 2018. Old themes have a 6 months grace time from this date. Since WordPress 5.8 theme readme files are not parsed for requirements. This means that headers Requires PHP and Requires at least are going to be parsed from theme’s style.css file.