07 Nov 2011

Contact Form 7: Get Parameter from URL into Form Plugin

Wordpress 1 Comment

There are times when using the Contact Form 7 WordPress plugin where I need to pass a parameter from the URL and into a hidden field into the form. This is great for passing things such as order numbers, selected packages, or even security information.

Download GetParam Here

Installation

  • Copy the getparam.php file into: /wp-content/plugins/contact-form-7/modules/

Usage

When editing a form in Contact Form 7, enter the getparam shortcode. There is only one valid parameter which is the name of the $_GET value.

[getparam value]

For example, if the URL is http://mysite.com/contact?ordernum=12345, the shortcode will be:

[getparam ordernum]

Then when building the response email, you can pass the value with [ordernum]

One Response to “Contact Form 7: Get Parameter from URL into Form Plugin”

  1. efendi says:

    great! really! very thank you!

Leave a Reply