I wanted to insert a form with a line of PHP code via shortcode. I am wondering if it's allowed? Has anyone tried it? Take the following for example:
function get_form($atts) {
return '<form method="post" action="">
<input type="input" name="myinput" value=""></input>
<input type="hidden" name="myvar" value="<?php echo $current_user->ID; ?>">
</form>';
}
add_shortcode('myshortcode', 'get_form');
I hope it's clear now...