add_shortcode
add_shortcode ( $tag, $callback )
Parameters:- (string) tag Shortcode tag to be searched in post content.
- (callable) callback The callback function to run when the shortcode is found. Every shortcode callback is passed three parameters by default, including an array of attributes (`$atts`), the shortcode content or null if not set (`$content`), and finally the shortcode tag itself (`$shortcode_tag`), in that order.
Defined at: - Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Description
Adds a new shortcode.Care should be taken through prefixing or other means to ensure that the
shortcode tag being added is unique and will not conflict with other,
already-added shortcode tags. In the event of a duplicated tag, the tag
loaded last will take precedence.