0

I want to add a filter to a form submission like it is done here.

add_action('gform_pre_submission_6', 'capitalize_fields_6');
function capitalize_fields_6($form){
    // Code here
}

My question is, how do you get the form ID on the WP admin side? Where is the number 6 coming from to access the form in the action?

3
  • If you look at the list of Forms (Forms > Forms) in the back end there's a column that tells you the ID. Commented Jul 26, 2018 at 15:37
  • @JacobPeattie You are correct. I'm new to the plugin and was had tunnel vision in the notifications/confirmations tabs :) If you answer I can select it.
    – Dan
    Commented Jul 26, 2018 at 15:44
  • 1
    Also, if you want to dynamically get a form ID for a form titled 'My Contact Form', you can use this class method to obtain it: RGFormsModel::get_form_id('My Contact Form')
    – jasonp
    Commented Jul 26, 2018 at 15:47

2 Answers 2

2

If you look at the list of Forms (Forms > Forms) in the back end there's a column that tells you the ID. You can also get it from the top of the screen when editing a form. Next to the form's Title there's an orange box that says "ID: 6".

1

3 ways you get view gravity form ID

There are 3 ways you can view the gravity form ID

  1. Via inspect element - when you are viewing the page were the gravity form is embedded. Right click on the form and choose Inspect element.

  2. When you are editing a specific form. It's on top highlighted with color orange.

  3. When you are viewing all the forms. A columns names such as ID, ENTRIES, VIEWS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.