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.

Leave a Reply

Your email address will not be published. Required fields are marked *