![]() Links in the form of URLs, such as related Trac tickets or other documentation, should be added in the appropriate place in the DocBlock using the tag:Įvery function, hook, class, and method should have a corresponding version associated with it (more on that below).Note that examples added in this way will be output in tags and not syntax-highlighted. Blank lines in code samples also need to be indented by four spaces. Code samples would be created by indenting every line of the code by 4 spaces, with a blank line before and after.* Description which includes an ordered list: Use numbers to create an ordered list, with a blank line before and after. * Description which includes an unordered list: Use a hyphen (-) to create an unordered list, with a blank line before and after. HTML markup should never be used outside of code examples, though Markdown can be used, as needed, in the description. Bad: Fires when printing the tag in the header.Good: Fires when printing the link tag in the header.If the text refers to an HTML element or tag, then it should be written as “image tag” or “img” element, not “ “. No HTML markup or Markdown of any kind should be used in the summary. There should not be any opening/closing tags or other things between the DocBlock and the declarations to prevent the parser becoming confused. As such, following the standards in core and formatting as described below are extremely important to ensure expected output.ĭocBlocks should directly precede the hook, action, function, method, or class line. WordPress’ inline documentation standards for PHP are specifically tailored for optimum output on the official Code Reference. Existing MU (3.0.0) tags should not be changed.Ĭode Refactoring: It is permissible to space out the specific action or filter lines being documented to meet the coding standards, but do not refactor other code in the file. If the version number cannot be determined after using these tools, use Unknown.Īnything ported over from WPMU should use MU (3.0.0). An additional resource for older hooks is the WordPress Hooks Database. ![]() The recommended tool to use when searching for the version something was added to WordPress is svn blame. The serial (Oxford) comma should be used when listing elements in summaries, descriptions, and parameter or return descriptions. The one exception to this standard is file header summaries, which are intended as file “titles” more than sentences.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |