打印变量内部功能' wp_editor'
我试图用树枝定义WordPress Textarea的初始值。 因此,我使用此代码:
{% set job_text = "test text" %}
{{ fn('wp_editor', "{{ job_text }}", 'post_content', {'textarea_name':'post_content','media_buttons': 0, 'wpautop':true, 'editor_height':'200px', 'quicktags': 0} ) }}
但是,此代码将带有文本{{job_text}}
而不是测试文本
而打印文本方面。 我使用了不同的选项(例如job_text
或{job_text}
),但它仍然打印出文本,而不是变量的值。
我在这里想念什么?
I am trying to define initial value for Wordpress textarea with twig.
So I use this code:
{% set job_text = "test text" %}
{{ fn('wp_editor', "{{ job_text }}", 'post_content', {'textarea_name':'post_content','media_buttons': 0, 'wpautop':true, 'editor_height':'200px', 'quicktags': 0} ) }}
But this code prints textarea with text {{ job_text }}
instead of test text
.
I used different options (like job_text
or { job_text }
) but it still prints text, not a variable's value.
What I miss here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现一个问题。感谢@darkbee。
它在
job_text
part中是错误的语法。正确的代码是:
I found a problem. Thanks to @DarkBee.
It was incorrect syntax in
job_text
part.Correct code is: