Embeds a published, public Google Form in a WordPress post, page, or widget.
As features have been added, usage of the gform shortcode has grown increasing complex. Begining with v0.46, a second shortcode, wpgform has been introduced in conjunction with a Custom Post Type to define forms deprecating usage of the gformn shortcode. Usage of the new shortcode and Custom Post Type is much, much easier than the complexities of the original gform shortcode. Users are strong encouraged to migrate usage to the new shortcode and Custom Post Type. New features will only be added to the Custom Post Type usage model.
The WordPress Google Form shortcode wpgform supports a single attribute. The rest of the controls are derived from the information stored with the Custom Post Type.
[wpgform id='<Google Form CPT Id>']
NOTE: In the above syntax, values enclosed in angle brackets <>, indicate a string you need to replace with an appropriate value. Do not include the angle brackets in your string!
The WordPress Google Form shortcode gform supports a number of attributes that allow further control and customization of the Google Form.
[gform form='<full_url_to_Google_Form>' confirm='<full_url_to_confirmation_page>' class='<value>' legal='on|off' br='on|off' prefix='<value>' suffix='<value>' email='on|off' sendto='<email address>' style='redirect|ajax' spreadsheet='<full_url_to_Google_Spreadsheet>' unitethemehack='on|off']
NOTE: In the above syntax, values enclosed in angle brackets <>, indicate a string you need to replace with an appropriate value. Do not include the angle brackets in your string!
legal='off' to your shortcode usage. The content remains in the form, it is simply hidden from the end user using CSS.title='off' to your shortcode usage. The <h1> content is removed from the form.maph1h2='on' to your shortcode usage. The <h1> elements will be mapped to <h2> elements. The CSS class attributes remain unchanged.unitethemehack='on', when using the Unite theme from Paralleus. The Unite theme manipulates the submit button(s) on a page, the result of which is a button that prevents the Google form from being submitted. Turning this attribute on enables a hack which inserts class="noStyle" to all submit buttons, preventing Unite from mucking with them.validation='on', to add jQuery based form validation support using the jQuery Validate Plugin. Enabling this optional attribute will allow inline checking without form submission to Google (which also does checking for required fields). Error messages can be styled using the gform-error CSS class.captcha='on', to add a simple math based CAPTCHA to the Google Form. The CAPTCHA only appears for the final submit on multi-page forms. The CAPTCHA error message can be styled using the gform-error CSS class.[gform form='https://docs.google.com/spreadsheet/viewform?hl=en_US&pli=1&formkey=ABCDEFGHIJKLMNOPQRSTUVWXYZ12345678#gid=0' confirm='http://www.example.com/thankyou/' style='ajax' class='mygform' legal='off' prefix='mygform-' br='on' title='on' maph1h2='on' email='on' spreadsheet='https://docs.google.com/spreadsheet/ccc?key=0AgBHWDGsX0PUdE56R1ZldXo4a0N3VTNMNEpSemdGV3c' unitethemehack='off' validation='on' captcha='on' columns='1']
Google Forms make use of 20+ CSS class definitions. By default, the WordPress Google Form plugin includes CSS declarations for all of the classes however the bulk of them are empty. The default CSS sets the font and makes the entry boxes wider. The default CSS that ships with WordPress Google Form can optionally be turned off via the WordPress Google Form settings.
There are two ways to customize the Google Form CSS.
As of 2013-05-17, the following is are the CSS classes which Google Forms make use of. The CSS below represents the default CSS provided by WordPress Google Form. These CSS definitions can be copied and pasted into your theme CSS or the WordPress Google Form custom CSS setting and changed as desired. Some of the classes are redundant to account for both the new and old style of Google Forms.
/* vim: set expandtab tabstop=4 shiftwidth=4: */
/**
* CSS declarations for Google Docs Forms
*
* These can be copied and modified to fit the needs of
* a theme. By default the only change is to make all of
* the fields wider than their default width and to set the
* default font.
*/
label.gform-error,
label.wpgform-error {
float: right;
color: red;
font-weight: bold;
}
div.gform-captcha,
div.wpgform-captcha {
margin: 5px 0px 10px;
display: none;
}
div.gform-browser-warning,
div.gform-browser-error,
div.wpgform-browser-warning,
div.wpgform-browser-error {
-webkit-border-radius: 3px;
border-radius: 3px;
border-width: 1px;
border-style: solid;
padding: 0 .6em;
margin: 5px 0 15px;
}
div.gform-browser-warning,
div.wpgform-browser-warning {
background-color: #ffffe0;
border-color: #e6db55;
}
div.gform-google-error,
div.gform-browser-error,
div.wpgform-google-error,
div.wpgform-browser-error {
background-color: #ffebe8;
border-color: #cc0000;
}
body.ss-base-body {}
div.errorbox-good {}
div.ss-attribution {}
div.ss-footer {}
div.ss-footer-txt, div.ss-logo {
display: none;
}
div.ss-form {}
div.ss-form-container {
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
div.ss-form-desc {}
div.ss-form-entry {}
div.ss-form-entry>input {
background-color: #e0e0e0;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
div.ss-form-heading {}
div.ss-item {}
div.ss-legal {}
div.ss-navigate {}
div.ss-no-ignore-whitespace {
white-space: pre-wrap;
}
div.ss-required-asterisk {
color: red;
font-weight: bold;
}
div.ss-scale {}
div.ss-text {}
form#ss-form {}
h1.ss-form-title {}
hr.ss-email-break {}
input.ss-q-short:text {
width: 300px;
}
label.ss-q-help {
display: block;
}
label.ss-q-radio {}
label.ss-q-title {
font-weight: bold;
}
span.ss-powered-by {}
span.ss-terms {}
td.ss-gridnumber {}
td.ss-gridnumbers {}
td.ss-gridrow
td.ss-gridrow-leftlabel
td.ss-leftlabel {}
td.ss-rightlabel {}
td.ss-scalerow {}
td.ss-scalenumber {}
td.ss-scalenumbers {}
textarea.ss-q-long {
background-color: #e0e0e0;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
}
tr.ss-gridrow {}
/**
* New Google Forms CSS 2013-04-30
*/
div.ss-form-container div.disclaimer {
display: none;
}
div.ss-q-help {
}
div.ss-secondary-text {
}
/* This hides the "Never submit passwords through Google Forms." warning. */
div.ss-form-entry > div.ss-secondary-text {
display: none;
}
div.password-warning {
display: none;
}
div.ss-form-container li {
list-style-type: none;
}
Requires: 3.3 or higher
Compatible up to: 3.5.1
Last Updated: 2013-5-23
Downloads: 50,466
8 of 10 support threads in the last two months have been resolved.
Got something to say? Need help?