To embed the WordPress Shortcode API outside of pages or posts (e.g. for plugin functionality), use the do_shortcode() function:
Syntax:
or:
To use shortcodes in text widgets, the add_filter() function can be used: add_filter('widget_text', 'do_shortcode'); Further information can be found at this link
