Shortcodes are a feature that allows for WordPress administrators to easily add components to their pages without having to understand HTML, CSS, PHP, JavaScript, or any programming language.
A shortcode is written inside two square brackets. For example, the [mu_alert]
shortcode can be used to add an alert to any page or post.
Some shortcodes require an opening and closing shortcode, with content in between. For example:
[mu_alert]This is my alert[/mu_alert]
Some shortcodes also have parameters that can be passed through, some are optional and some are required. For example, if we wanted a green alert instead of the default alert:
[mu_alert type="green"]This is my alert[/mu_alert]
You can learn more about the example used here by visiting the documentation page for alerts.