Answer the question
In order to leave comments, you need to log in
How to output PHP variable in WordPress (Elementor)?
Hello! I will explain right away, you need to output the variables $a and $b as the value of the value attribute in input .
I also tried plugins that supposedly output php shortcodes and a method with output like [exec][/exec] , I also wrote shortcodes myself in function.php, tried many plugins to revive php somehow, but nothing helps, <?php echo $ a; ?> doesn't work and looks like <--?php echo $a; ?--> (not functional). I tried both in elementor the above, and in the standard Wordpress post editor.
Layout on Elementor initially.
...
$a = base64_encode( json_encode($arr));
$b = base64_encode( sha1($pk .$a .$pk, 1 ));
...
<form method="POST" action="сайт.ру/обработчик.php" >
<input type="hidden" name="a" value="<?php echo $a; ?>"/>
<input type="hidden" name="b" value="<?php echo $b; ?>"/>
<button type="submit" name="submit">Submit </button>
</form>
Answer the question
In order to leave comments, you need to log in
Install the plugin https://ru.wordpress.org/plugins/insert-php-code-s...
and paste your PHP code and copy the shortcode into Elementor.
Another option - without a plugin, create your shortcode via add_shortcode and paste it into the editor
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question