Welcome to the official home of the WordPress Documentation Team.
This team is responsible for coordinating all documentation initiatives around WordPress, including the handbooks and other general wordsmithing across the WordPress project.
Want to get involved?
Start here to find out more about what we do and how to contribute:
Documentation Issue Tracker on GitHub: Submit any Documentation Team-related issues on GitHubGitHubGitHub is a website that offers online implementation of git repositories that can easily be shared, copied and modified by other developers. Public repositories are free to host, private repositories require a paid subscription. GitHub introduced the concept of the ‘pull request’ where code changes done in branches by contributors can be reviewed and discussed before being merged be the repository owner. https://github.com/
Weekly meetings
Join our discussions of documentation issues here on the blog and on Slack.
Note:Highlight: Use code blocks, preformatted text, and code fences to write code examples.
In documentation, mark a block of code such as a lengthy command or a code example to distinguish it from standard text. To express code examples in HTML, use the <pre> element. In Markdown, use a code fence (```).
This page explains how to format code examples in documentation. For more information about other code-related documentation, see Code in text, Placeholders, and Command-line syntax.
For more information about adding code blocks in the Gutenberg block editor, see Code block and Preformatted block.
<pre class="example">
function longSentence() {
alert('This example of a sentence is very long and wraps onto a second
line.');
}
</pre>
This preformatted code example renders a code blockBlockBlock is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. with syntax highlighting as follows:
function longSentence() {
alert('This example of a sentence is very long and wraps onto a second
line.');
}
In most cases, introduce a code example with an introductory sentence that initiates the example that follows. If the heading of the content explains what the code example is about, and no additional context is required, then don’t include an introductory statement. You can introduce a code example with an imperative statement.
The introductory sentence can end with a colon or a period. Use a period if the introductory content is extended, and a colon if the introductory statement is shorter and immediately precedes the code example. The text preceding the colon must distinctly stand alone as a complete sentence. That is, don’t introduce a code example with a partial statement.
Examples
Warning:Not recommended (ending with a colon): The following code example shows how to use the post method. For information on other methods, refer the Code reference: [Code example]
Tip:Recommended (ending with a period): The following code example shows how to use the post method. For information on other methods, refer the Code reference. [Code example]
Tip:Recommended: The following code example shows how to use the post method: [Code example] For information on other methods, see the Code reference.