Categories
CMS Development Wordpress

How to add shortcode to html widget

I’m trying to include a shortcode to an html widget by adding below code to functions.php add_filter( ‘widget_text’, ‘shortcode_unautop’); add_filter( ‘widget_text’, ‘do_shortcode’); and to the html widget <script>alert(“‘” + [user_email] + “‘”);</script> but it keeps saying user_email is not defined.

Categories
CMS Development Wordpress

How to add shortcode to html widget

I’m trying to include a shortcode to an html widget by adding to functions.php add_filter( ‘widget_text’, ‘shortcode_unautop’); add_filter( ‘widget_text’, ‘do_shortcode’); and to the html widget alert(“‘” + [user_email] + “‘”); but it keeps saying user_email is not defined.