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.
有人能帮忙吗?
add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) {
if ( $context == 'post' ) {
$allowedposttags['input']['value'] = 1;
}
return $allowedposttags;
}, 10, 2 );
我想在 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.
有人能帮忙吗?
add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) {
if ( $context == 'post' ) {
$allowedposttags['input']['value'] = 1;
}
return $allowedposttags;
}, 10, 2 );