简体   繁体   English

将PHP代码添加到在woocommerce支持的网站中使用Visual Composer创建的按钮中

[英]Add PHP code to a button created using Visual Composer in a woocommerce powered website

I have created a form using visual composer. 我已经使用视觉作曲家创建了一个表单。 In this form I want to assign a PHP function defined in functions.php to the submit button. 在这种形式下,我想将functions.php中定义的PHP函数分配给Submit按钮。

How can I do this? 我怎样才能做到这一点?

You Can Do Like This 你可以这样

// Your Shortcode to output the custom PHP in Visual Composer.
function my_vc_shortcode( $atts ) {
   // Your Custom Php Code Here 
   return '<h2>This is my custom PHP output!</h2>';
}
add_shortcode( 'my_vc_php_output', 'my_vc_shortcode');

Check Source Code Here: 在此处检查源代码:

  1. https://theremotedev.com/custom-php-code-visual-composer-pages/ https://theremotedev.com/custom-php-code-visual-composer-pages/
  2. Insert PHP code into the Visual Composer 将PHP代码插入Visual Composer

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM