开发者

How to include write a php function that defines a variable that holds html and php?

开发者 https://www.devze.com 2023-02-09 07:50 出处:网络
I need to write a function that defines a variable with html markup, now within that html markup I need to include a php snippet that has to be passed through a hook then outputted to my browser. With

I need to write a function that defines a variable with html markup, now within that html markup I need to include a php snippet that has to be passed through a hook then outputted to my browser. Within my span tags I need the php snippet to output correctly.

The php snippet is this

<?php gravity_form(1, true, true, false, '', true); ?>

My function is below notice how the php snippet is formatted, I need to find out how to properly format it.

    function html_fxcntab_hidden_gform() {

    $html_fxcntab_hidden_gform_div = "<span style= \"display:none\";> <?php gravity_form(1, true, true, false, '', true); ?> </span>";

    echo $html_fxcntab_hidden_gform_div;
}

add_action('wp_fo开发者_StackOverflowoter', 'html_fxcntab_hidden_gform');

Thanks,

Michael Sablatura


function html_fxcntab_hidden_gform() {
?>
  <span style="display:none"> <?php gravity_form(1, true, true, false, '', true); ?> </span><?php
}
0

精彩评论

暂无评论...
验证码 换一张
取 消