【发布时间】:2010-09-17 16:13:13
【问题描述】:
我不知道您需要多少信息,但 WP-ContactForm-7 是 WordPress 的联系表格。默认情况下,它为网站上的所有表单提供一条服务器响应消息。我有多个表单,并且希望为每个表单提供不同的服务器响应消息。
如何为使用此插件创建的每个不同表单创建不同的服务器响应消息?
以下是插件中 PHP 代码的 sn-p,它似乎与联系表单显示的消息有关:
function message($status) {
switch ($status) {
case 'mail_sent_ok':
return __('Your message was sent successfully. Thanks.', 'wpcf7');
case 'mail_sent_ng':
return __('Failed to send your message. Please try later or contact administrator by other way.', 'wpcf7');
case 'validation_error':
return __('Validation errors occurred. Please confirm the fields and submit it again.', 'wpcf7');
case 'accept_terms':
return __('Please accept the terms to proceed.', 'wpcf7');
case 'invalid_email':
return __('Email address seems invalid.', 'wpcf7');
case 'invalid_required':
return __('Please fill the required field.', 'wpcf7');
case 'captcha_not_match':
return __('Your entered code is incorrect.', 'wpcf7');
}
}
如果这还不够信息,那么您可以从here 下载文件并查看整个源代码。
【问题讨论】:
-
您可能想稍微改写一下。目前尚不清楚这里是否存在问题,或者您是否正在分享您遇到的问题的解决方案。
标签: php wordpress contact-form-7