将PHP代码添加到在使用woocommerce供电的网站中使用Visual Composer创建的按钮
问题描述:
我使用visual composer创建了一个表单。在这种形式下,我想将functions.php中定义的PHP函数分配给提交按钮。将PHP代码添加到在使用woocommerce供电的网站中使用Visual Composer创建的按钮
我该怎么做?
答
你可以这样做
// 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');
检查源代码在这里:
如何将shortcode与表单的按钮相关联,因为没有正式的机制来做 –
非常感谢。你也可以帮助我在视觉作曲家客户端验证? –
yaa sure ..但你不能问一个在两个问题,根据每个stackoverflow termsandcondition你要问一个新的问题 –