Category: Shortcode Concepts
When working with conditional shortcodes it’s often useful to have a series of tests, one after another, where each test determines if the user is qualified to continue to the next test.
Due to a limitation in WordPress’s design, the built-in shortcode system is very fast but it does not know how to count levels of nesting, so it cannot match each opening tag with its correct closing tag. In order to cleanly support this feature while not sacrificing performance, we provide the ability to nest shortcodes by giving each nested group of shortcodes a unique name by adding a number to the end. You can think of this like a Russian Matryoshka doll.
Conditional shortcodes perform a test and then display (or don’t display) the content within the shortcode depending on the result of the test. Conditional shortcodes are often nestable so that you can perform multiple tests. All tests are binary meaning they resolve to a simple true-false / sucess-fail / yes-no condition.