Structure of a shortcode

In this section, we are going to understand WordPress shortcode by considering the perspective of different user types. As a developer, it's important to understand all the three user perspectives to build and use shortcodes in development tasks. Let's take a look at the following diagram:

The preceding diagram is based on the three user perspectives involved in the process of using shortcodes.

The use of content is optional for a shortcode. We can find many self-enclosing shortcodes that generate the output without using any content.

Let's understand each of these three user perspectives.

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.