Placeholders

Highlight: Enclose placeholders in a <var> element and use uppercase characters with underscore delimiters.

Placeholders in code and commands represent values that the user must input or replace. Placeholders in outputs can also represent values that differ. Generally, placeholders have a descriptive name and a value.

For example, POST_ID represents a post ID in a code example, command, and example output. In example output, VERSION represents the version of a pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party., theme, or software; the reader is not expected to set this to a specific value.

This page explains how to format placeholder variables in commands and code examples. For more information about other code-related documentation, see Code in text, Code examples, and Command-line syntax.

Placeholder variables

Placeholder variables in inline text

When placeholder variables appear in a sentence, use the following formatting:

  • In HTMLHTML HTML is an acronym for Hyper Text Markup Language. It is a markup language that is used in the development of web pages and websites., enclose inline placeholders in <code><var> elements.

html
<code>PLACEHOLDER_VARIABLE</code>

  • In Markdown, enclose inline placeholders in backticks (`) and use an asterisk (*) before the first and second backtick.

markdown
*`PLACEHOLDER_VARIABLE`*

Placeholder variables in code blocks

When placeholder variables are in a blockBlock Block 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. of code, use the following formatting:

{% codetabs %}
{% HTML %}

Enclose the code block in a <pre> element and tag placeholders with <var> elements.

&lt;pre class=&quot;prototype&quot;&gt;
&lt;img
  src=&quot;&lt;var&gt;IMAGE_PATH&lt;/var&gt;&quot;
  alt=&quot;&lt;var&gt;ALT_TEXT&lt;/var&gt;&quot;
/&gt;
&lt;/pre&gt;

{% Markdown %}

Enclose the code block in a code fence. You cannot apply text formatting or highlighting such as bold or italic inside a code fence.

“`
*PLACEHOLDER_VARIABLE*
“`

{% end %}

Placeholder variable text

For text in placeholder variables, use uppercase characters with underscore delimiters. If using uppercase characters with underscore delimiters, or capitalizing lowercase characters with already uppercase characters seems inconsistent, then it is acceptable to use another convention; but be consistent with that convention.

Examples

{% codetabs %}
{% HTML %}

Not recommended:
https://developer.wordpress.org/<var>API-name</var>
https://developer.wordpress.org/<var>API_name</var>
https://developer.wordpress.org/<var>API name</var>
https://developer.wordpress.org/<var>api_name</var>
https://developer.wordpress.org/<var>api-name</var>
https://developer.wordpress.org/<var>apiName</var>


Recommended:
https://developers.google.com/<var>API_NAME</var>
https://developers.google.com/<var>POST_TITLE</var>


{% Markdown %}

Not recommended:
https://developer.wordpress.org/*API-name*`
-
https://developer.wordpress.org/*API name*-https://developer.wordpress.org/*API_name*`
https://developer.wordpress.org/*api_name*`
-
https://developer.wordpress.org/*api-name*`
– `https://developer.wordpress.org/*apiName*`


Recommended:
https://developers.google.com/*API_NAME*`
-
https://developers.google.com/*POST_TITLE*`


{% end %}

Don’t use possessive pronouns in placeholder variables.

Examples
{% codetabs %}
{% HTML %}

Not recommended:
https://developer.wordpress.org/<var>MY_API_NAME</var>
https://developer.wordpress.org/<var>YOUR_API_NAME</var>

{% Markdown %}

Not recommended:
https://developer.wordpress.org/*MY_API_NAME*`
-
https://developer.wordpress.org/*YOUR_API_NAME*`


{% end %}

For more information about placeholder text in commands, see Optional arguments, Mutually exclusive arguments, and Multiple value arguments.

Describing placeholders

When you use a placeholder in code examples, commands, or other text, include an explanation for what the placeholder represents. Write an explanation for the first time you use the placeholder; if there are multiple placeholders or steps after the first use of that placeholder, you can explain the placeholder again.

Use the following order to describe placeholders:
– Describe what the user is doing.
– Write the code example, command, or other text.
– Explain the placeholder.
– Explain the code example, command, or other text in more detail if required.
– Show any output if required.
– Explain any output if required.

Example

Recommended:

<br />
&lt;pre class=&quot;prototype&quot;&gt;<br />
&lt;img<br />
  src=&quot;&lt;var&gt;IMAGE_PATH&lt;/var&gt;&quot;<br />
  alt=&quot;The WordPress mascot Wapuu.&quot;<br />
/&gt;<br />
&lt;/pre&gt;</p>
<p>&lt;p&gt;Replace the following:&lt;/p&gt;</p>
<p>&lt;ul&gt;<br />
  &lt;li&gt;&lt;code&gt;<var>IMAGE_PATH</var>&lt;/code&gt;: the directory path of the image asset.&lt;/li&gt;<br />
&lt;/ul&gt;<br />

Single placeholder

When writing a single placeholder, replace PLACEHOLDER with a description of what the placeholder represents.

Example

Recommended:
To delete an existing post, enter the following command:

$ wp post delete POST_ID

Replace POST_ID with the ID of the post that you want to delete.

Multiple placeholders

When there are two or more placeholders in code examples, commands, or other text, use the following formatting:
– Write a descriptive list of all the placeholder variables used in the respective code example, command, or other text, after the code content.
– Explain what each placeholder variable represents.
– Introduce the placeholder description list with Replace the following:
– List all the placeholder variables in the order in which they appear in the code example, command, or other text.
– Provide a description for each placeholder variable.
TagTag Tag is one of the pre-defined taxonomies in WordPress. Users can add tags to their WordPress posts along with categories. However, while a category may cover a broad range of topics, tags are smaller in scope and focused to specific topics. Think of them as keywords used for topics discussed in a particular post. each placeholder with <code><var> elements, followed by a colon and lowercase letter as follows:
html
<li><code>PLACEHOLDER</code>: description</li>

Example

Recommended:
To edit an existing post, enter the following command:

$ wp post edit POST_ID --path=PATH --skip-themes[=THEMES]

Replace the following:
POST_ID: the ID of the post that you want to edit.
PATH: the path to the WordPress files.
THEMES: skip loading all themes, or a comma-separated list of themes.

Placeholders in output

When you specify placeholders in output examples, use the following formatting:
– Write a descriptive list of all the placeholder variables used in the output, after the output example.
– Introduce the placeholder description list with In this output:
– List all the placeholder variables in the order in which they appear in the output example.
– Provide a description for each placeholder variable.
– Tag each placeholder with <code><var> elements, followed by a colon and lowercase letter as follows:
html
<li><code>PLACEHOLDER</code>: description</li>

For more information, see Command output.

Example

Recommended:
The output is similar to the following:

{
    "name": "SITE_NAME",
    "description": "SITE_DESCRIPTION",
    "routes": { ... },
    "authentication": {
        "oauth1": {
            "request": "OAUTH_REQUEST_URL",
            "authorize": "OAUTH_AUTHORIZE_URL",
            "access": "http://example.com/oauth/access",
            "version": "0.1"
        }
    }
}

In this output:

  • SITE_NAME: the name of the site.
  • SITE_DESCRIPTION: the description of the site.
  • OAUTH_REQUEST_URL: the OAuth requesting URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org.
  • OAUTH_AUTHORIZE_URL: the OAuth authorizing URL.

s
search
c
compose new post
r
reply
e
edit
t
go to top
j
go to the next post or comment
k
go to the previous post or comment
o
toggle comment visibility
esc
cancel edit post or comment