WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. John Peden
    Member
    Posted 2 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?

    John

    http://wordpress.org/extend/plugins/contact-form-7/

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 2 years ago #

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

    http://contactform7.com/blog/2009/12/25/special-mail-tags/

  3. John Peden
    Member
    Posted 2 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
    Member
    Posted 2 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).

    Brilliant!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic