What is a Shortcode?
Shortcodes in WordPress are little bits of code that allow you to do various things with little effort. Shortcodes allow you to simply embed content into a page or post. For example, a shortcode for embedding the scoop widget might look like this:
In this example above:
- the shortcode is called widget-v2-html.
- The shortcode name must be enclosed with square brackets.
- The shortcode has a prefix [widget-v2-html].
- The shortcode also has a suffix [/widget-v2-html] – note the slash before the shortcode name.
- Between the prefix and the suffix are what is know as widget data props – these are values passed to the widget to indicate what content the widget should display and in what format.