php 如何通过联系表 7 获取帖子标题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29374776/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 00:22:41  来源:igfitidea点击:

How to get post title by contact form 7

phpwordpresscontact-formcontact-form-7

提问by AB Siddik

I'm using contact form 7 in a website for get REQUEST QUOTEof each product.

我在网站上使用联系表 7 来获取REQUEST QUOTE每种产品。

Link to example

链接到示例

When visitor submit the REQUEST QUOTEform then I get a mail with desalts and want to get each single post title in that mail. I used [_post_title]code for get single post title and I got title. But I got only one post title from top of the page.

当访问者提交REQUEST QUOTE表单时,我会收到一封带有脱盐的邮件,并希望获得该邮件中的每个帖子标题。我使用[_post_title]代码获取单个帖子标题,然后我得到了标题。但是我从页面顶部只得到了一个帖子标题。

How I can get every single post title in the mail ?

如何获得邮件中的每个帖子标题?

回答by IT NHAT VIET

Here you are,

这个给你,

  • [_remote_ip]This tag will be replaced by the sender's client IP address.
  • [_user_agent]This tag will be replaced by the sender's user agent information.
  • [_url]This tag will be replaced by the URL of the contact form.
  • [_date]This tag will be replaced by the date of the submission.
  • [_time]This tag will be replaced by the time of the submission.
  • [_post_id]This tag will be replaced by the ID of the post which contains the contact form.
  • [_post_name]This tag will be replaced by the name (slug) of the post which contains the contact form.
  • [_post_title]This tag will be replaced by the title of the post which contains the contact form.
  • [_post_url]This tag will be replaced by the permalink of the post which contains the contact form.
  • [_post_author]This tag will be replaced by the author name of the post which contains the contact form.

  • [_post_author_email]This tag will be replaced by the author email of the post which contains the contact form.

  • [_serial_number]This tag will be replaced by a numeric string whose value increments. Requires Flamingo 1.5+ be installed.
  • [_remote_ip]此标签将被发送方的客户端 IP 地址替换。
  • [_user_agent]该标签将被发件人的用户代理信息替换。
  • [_url]此标记将替换为联系表单的 URL。
  • [_date]该标签将被提交日期替换。
  • [_time]这个标签会在提交的时候被替换。
  • [_post_id]此标签将替换为包含联系表单的帖子的 ID。
  • [_post_name]此标签将替换为包含联系表单的帖子的名称(slug)。
  • [_post_title]此标签将替换为包含联系表单的帖子标题。
  • [_post_url]此标签将被包含联系表格的帖子的永久链接替换。
  • [_post_author]此标签将替换为包含联系表单的帖子的作者姓名。

  • [_post_author_email]此标签将被包含联系表格的帖子的作者电子邮件替换。

  • [_serial_number]该标签将被一个数值递增的数字字符串替换。需要安装 Flamingo 1.5+。

Hope them will help you, You can also see more here. See document for Contact Form 7 Get: post id, post title, post url,..and more

希望他们能帮助你,你也可以在这里看到更多。 请参阅联系表格 7 的文档获取:帖子 ID、帖子标题、帖子网址等

回答by shekhar

Use [ss_post_title] to show your post title in mail content, and write a script in your template file or header/footer.

使用 [ss_post_title] 在邮件内容中显示您的帖子标题,并在您的模板文件或页眉/页脚中编写脚本。

$(document).ready(function(){
   $('.ss_post_title').hide();
   $('.applt').on('click',function()
   {
       var ttlpost = $('.panel-heading.active span.posttitl').text();
       $('.ss_post_title input').val(ttlpost);
   });
});

Please use classes according to your code.

请根据您的代码使用类。