我有脚本,我设置占位符:
$mailargs = array(
'nametxt' => '',
'emailtxt' => '',
'nameholder' => 'Your Name',
'emailholder' => 'Your Email Address',
'submittxt' => 'GO',
'jsthanks' => true,
'thankyou' => 'Thank you for subscribing to our mailing list'
);
现在我需要将这部分代码放在nameholder中:
<?php _e('Stay in touch with latest news,events and exhibitions by subscribing to our official newsletter', 'wp-test'); ?>
有任何建议怎么做?
答案 0 :(得分:1)
您可以在数组中包含_e()
函数:
$mailargs = array(
'nametxt' => '',
'emailtxt' => '',
'nameholder' => _e('Your Name','wp-test'),
'emailholder' => _e('Your Email Address','wp-test'),
'submittxt' => _e('GO','wp-test'),
'jsthanks' => true,
'thankyou' => _e('Thank you for subscribing to our mailing list','wp-test')
);
这将在$mailargs
数组中为您提供所需的结果。