[英]PHP Variable within Wordpress shortcode
我需要使用简码,但要将客户输入的变量插入简码中。
我尝试使用以下内容:
echo do_shortcode('[su_accordion][su_spoiler title="What is your name and your position in the company?"]'.the_field('whats_your_name_and_your_position_in_the_company').'[/su_spoiler][/su_accordion]');
但是,它只是将回声文本放在手风琴的短代码http://prntscr.com/3zzfv9之上。
有任何想法吗?
谢谢!
在这里找到答案https://wordpress.stackexchange.com/questions/77384/echo-do-shortcode-with-custom-field-not-working
需要使用get_field而不是the_field
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.