The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Contact Form 7
How To pass variable (like page slug) into WordPress Contact Form 7? (4 posts)

  1. John Peden
    Posted 4 years ago #

    I'm using WP Contact Form 7 as a training event registration form. Clients hit the event list page, pick their event and click 'register here' which takes them the to registration page where I'm calling the form.

    At the moment, they have to manually select their event at this point but I'd like to automatically pass the page slug as a variable into the form when they click through.

    Is this possible? How would I call the variable in the messages that are generated by the form?



  2. Takayuki Miyoshi
    Plugin Author

    Posted 4 years ago #

    Put [_post_name], [_post_title] or [_post_url] inside mail message body.


  3. John Peden
    Posted 4 years ago #

    Thanks for the reply, that is certainly a start! Would it be possible to do something like this:

    Event page -> Training registration page

    With the slug of the event page being passed into the training registration page?

  4. John Peden
    Posted 4 years ago #

    Thinking about it Takayuki,

    I could create a generic form and call if on each event page. Then using the markup you suggested, I can load in the event (as it will by the post name).


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic