I am trying to define a variable for a plugin using a php variable inside of a shortcode in WordPress.

What I want to use is this:

[wpdatachart id=16 var1="<?php echo um_profile_id(); ?>"]

Obviously this won’t work, but what is the proper way of writing this?

Read more here: How do I use a php echo inside a short code in WordPress?


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: