Get More Out of Gravity Forms

Gravity Forms screenshots

Vancouver WordPress Meet-up – May 15, 2014

What We'll Cover:

  1. The challenge
  2. Gravity Forms vs. ...
  3. Get more out of the box
  4. Get more with hooks
  5. Some gotchas

The Challenge

SBBC Awards screenshot


  • A form that would accept user-submitted nominations and save them as a custom post type
  • A voting mechanism for each award category that only allowed a person to vote once per person per category


Gravity Forms!

Gravity Forms logo vs. Ninja Forms logo

Single license: $39

Single license: $0 + ???

User analytics: $19
File uploads: $39
Front-end posting: $39
Multi-part forms: $39
Conditional logic: $29
TOTAL: $165

Out of the Box Magic

Form Fields in a Snap

User-Submitted Posts

But What About CPTs?

There's a plugin for that.

Needed to turn this...

SBBC Awards nomination form

Into this:

SBBC Awards nominee example

Gravity Forms +
Custom Post Types

Find it WP plugin directory:

Better yet, get it from Github*:

*No PHP error notices with WP DEBUG on.

Forms in Modals

Fancybox (or another modal plugin) will allow you to easily show or or hide your form on demand.

In a Theme File

Initially hidden form + Ajax submitting= no-fuss modal perfection!

In the Wild

SBBC Awards voting form

In the Wild

SBBC Awards voting form success

Get More with Hooks

Around 200 actions & filters you can use to extend GF...

Where Does It Go?

  1. Your theme's functions.php file
  2. A functionality plugin

Auto-populate Fields

Many ways to go about this!

gform_field_value_[your custom param]

gform_pre_render_[your form ID]

gform_field_value_[your custom param]

Use this filter for text fields or pre-selection of options in a dropdown, etc. See the offcial docs here.

gform_field_value_[your custom param]

gform_pre_render_[your form ID]

Use this filter to pre-populate choices in a dropdown, etc. See the offcial docs here.

Check out a sample Gist.

Custom Validation

Be the boss of your form AND database!

gform_validation_[your form ID]

gform_validation_[your form ID]

See the offcial docs here.

Restrict Upload Size

There's no way to do this out of the box and you may not want users uploading 32MB files!

There is a plugin for that, but it's buggy. Instead...

Check out this Gist.

Custom Check for Duplicates

Preventing duplicates is easy... preventing a single user from submitting the same field value twice is harder.

Check out this Gist.

Some Gotchas

  • Duplicate prevention (use this plugin)
  • Ajax and captcha
  • And on the topic of spam...

That's all folks!

Find me: @mandiwise and

All of the snippets: