WP - 在 HTML 表单字段中使用简码

WP - Use shortcode in HTML form field

我想在 Wordpress 网站上以 HTML 形式使用短代码。

示例:

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

Now it returns like this while I would like it to return something like this.

有人能帮忙吗?

在这里找到答案: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 );