WordPress CF7 Shortcode with PHP -
using contact form 7 db plugin able run shortcode
[cfdb-value form="list store" filter="store-name=my store"] but want utilize like
[cfdb-value form="list store" filter="store-name=[php] echo $_session['store-name']; [/php]"] the above 1 not working, tried like
echo do_shortcode('[cfdb-value form="add store"]'); i want utilize php echo instead of store-name=my store
any help highly appreciated. thanks.
you can't evaluate php code within editor unless have plugin installed that, , such plugin utilize eval() function. problem if there nested shortcodes, handler outer shortcode must filter inner one.
there many plugins evaluating php code saved in database part of post. think evaluating php code not within .php file wrong. main purpose of shortcodes give ability perform task, modify content of post ( according parameters provided in shortcode ), , should done within shortcode handler.
if want manually utilize shortcode do:
echo do_shortcode( '[cfdb-value form="list store" filter="store-name=' . $_session['store-name'] . '"]' ); php wordpress wordpress-plugin shortcode contact-form-7
No comments:
Post a Comment