【问题标题】:Add PHP code to a button created using Visual Composer in a woocommerce powered website在 woocommerce 支持的网站中将 PHP 代码添加到使用 Visual Composer 创建的按钮
【发布时间】:2018-02-18 06:19:02
【问题描述】:

我使用可视化作曲家创建了一个表单。在这个表单中,我想将 functions.php 中定义的 PHP 函数分配给提交按钮。

我该怎么做?

【问题讨论】:

    标签: php woocommerce visual-composer


    【解决方案1】:

    你可以这样做

    // 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');
    

    在此处查看源代码:

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

    【讨论】:

    • 如何将简码与表单的按钮相关联,因为没有正式的机制来做到这一点
    • 非常感谢。您还可以帮助我在可视化作曲家中进行客户端验证吗?
    • 是的,当然.. 但你不能同时提出两个问题,根据 stackoverflow 的条款和条件,你必须提出一个有问题的新问题
    • @AarthnaMaheshwari 如果您得到第一个问题的答案,然后投票并打勾
    • @AarthnaMaheshwari ..它可以帮助您在客户端进行验证....archive.sap.com/kmuuid2/b0969ff9-e0b3-2b10-fe9e-80509bfda414/…
    猜你喜欢
    • 2014-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-06
    相关资源
    最近更新 更多