[
immediately followed by the shortcode
name, followed by some parameters followed by a right square bracket ]
.
e.g. [shortcode]
Shortcodes which work work on embedded content ( such as [bw_css] ) are then followed by the shortcode content then the shortcode closing tag, which is similar to the opening tag but has a slash /
after the left square bracket [
e.g.
[shortcode]embedded content[/shortcode]
Let’s take a look at an example for the bw_telephone shortcode.
Help for shortcode: [bw_telephone]
Telephone number (block)Syntax
[bw_telephone
prefix="Tel| string - Prefix string"
sep=": | string - Separator string"
alt="| 1 - Use alternative value"
number="| number - Number override"
tag="div| tag - enclosing HTML tag"
class="| class names - CSS class names"
link="| n| y| t| s| other: - tel: or sms: link"
index="telephone| field - oik options field to use"]
Example
oik generated example.
[bw_telephone]
Tel: +44 (0)2392 410090
The syntax shows the parameters of the form parameter_name=default | alternative | another - short explanation
Before the equals sign is the parameter name. After the equals sign is the default value that will be used if you don’t specify the parameter followed by a set of alternative values you may use, separated by vertical bars. Spaces are there to allow wrapping of the syntax when there are a lot of acceptable alternatives.
Sometimes the values are free form so are shown in italics.
Some parameters accept multiple values, with each value separated by a comma.
After the possible values is a short explanation of the parameter.
There are also shortcodes which assume certain parameter values based on their position after the shortcode.
Some shortcodes use multiple parameter names for the same thing.
He we see that the default values for the bw_telephone shortcode are:
parameter | default | Explanation |
---|---|---|
prefix | Tel | The prefix text appearing before the separator |
sep | : | the separator between the prefix and the telephone number |
tag | div | the tag used to surround the expanded shortcode |
index | telephone | the name of the options field used to obtain the telephone number |