WordPress 编码标准

💡 云策文档标注

概述

WordPress 是一个由数千名贡献者共同参与的大型项目,遵循最佳实践有助于保持代码库一致、可读,并使变更易于查找和理解。本文汇总了 WordPress 开发中应遵循的编码与文档规范,以确保代码长期保持整洁并具备良好文档支持。

关键要点

  • 统一遵循最佳实践可提升代码库的一致性、可读性和可维护性,无论代码是新近编写还是多年遗留。
  • WordPress 编码规范涵盖无障碍、CSS、HTML、JavaScript 和 PHP 等方面。
  • 内联文档规范包括 JavaScript 文档规范与 PHP 文档规范。
  • 开发时应同时关注代码编写标准与文档标准,便于后续查找、阅读和维护。

📄 原文内容

WordPress is a big project with thousands of contributors. It’s important that best practices are followed so that the codebase is consistent and readable, and changes are easy to find and read, whether the code is five days old or five years old. What follows are a series of best practices to help keep WordPress code clean and well documented for years to come.