【问题标题】:WP - Use shortcode in HTML form fieldWP - 在 HTML 表单字段中使用简码
【发布时间】:2018-08-02 18:56:12
【问题描述】:

我想在 Wordpress 网站的 HTML 表单中使用简码。

例子:

  <input type="text" name="EMAIL" value="[shortcode_here]" required />
<input type="submit" value="Submit" />

Now it returns like this,而我想将它发送给return something like this

有人可以帮忙吗?

【问题讨论】:

    标签: html wordpress forms shortcode


    【解决方案1】:

    在这里找到答案:https://wordpress.stackexchange.com/questions/195665/why-do-shortcode-is-not-executing-the-shortcode-in-data-html-attributes/195673#195673

    add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) {
        if ( $context == 'post' ) {
            $allowedposttags['input']['value'] = 1;
        }
        return $allowedposttags;
    }, 10, 2 );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-07-21
      • 2014-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-29
      相关资源
      最近更新 更多