[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

How should I read the shortcode syntax?

The oik shortcode help often displays some complex syntax. How am I supposed to interpret it so that I can work out what I need to use? Answer: The general form of a shortcode is a left square bracket [ 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:
parameterdefaultExplanation
prefixTelThe prefix text appearing before the separator
sep:the separator between the prefix and the telephone number
tagdivthe tag used to surround the expanded shortcode
indextelephonethe name of the options field used to obtain the telephone number
So when the shortcode is used without any parameters then it uses the defaults. For more advanced shortcodes which query the database, such as bw_posts and pw_pages, then the parameters can be far more complex, and require a certain understanding of the ways you can query posts using the WordPress functions. The oik shortcodes expose many of the parameters that you can pass to the WordPress functions.

Published: July 14, 2014 | Last updated: July 14, 2014

Information

Component:
  • oik – oik information kit
Question has actually been asked: Yes
Letters:

Recent plugin updates

oik-weight-zone-shipping v0.2.6 oik-weight-zone-shipping v0.2.6 has been tested with WooCommerce 7.4.0. ...
sb-chart-block v1.2.3 SB Chart Block v1.2.3 contains a fix for an Uncaught Error: Call to undefined function bw_trace2()  ...
SB Chart Block v1.2.1 Update to SB Chart Block v1.2.0 for custom colors, font size options and multiple y-axis charts.  ...
oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...
oik-types v2.3.0 Update to oik-types v2.3.0 for improved control over sort order on archives ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: oikplug@oik-plugins.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.1.1. PHP: 7.4.33. Memory limit: 768M