Posted on Leave a comment

Handy Code Snippets for Gravity Forms on your Child Site


Gravity Forms is a solid, easy-to-use form plugin which has a number of add-ons and free plugins.

Gravity Forms has a number of filters, actions, and hooks which allow you to modify most parts, using code snippets. MainWP has an easy-to-use extension for code snippets, so you can save a code snippet to any connected child site.

The first of the useful code snippets for Gravity Forms is to change the default save and continue function in Gravity Forms, from the default of 30 days to a longer 90 days.

The second snippet is to disable automatic plugin updates for the core Gravity Forms plugin. This would be useful when you want to manually update the Gravity Forms plugin on a staging site, first to test before updating.

The next code snippet is where you wanted to require the card holder field on a form which has product fields and has a payment feed set on it.

Gravity Forms has a country select field. If you wanted to remove a country in the country select field, you can define the country, and use this code snippet.

The final code snippet applies if you are already using the Akismet plugin and service on your child site; Gravity Forms already has default integration with it. To send a specific form to Akismet, you can use this code snippet. If you needed to globally disable the Akismet integration in Gravity Forms, you can use this code snippet.

Easily adding code snippets to your connected child sites (which have Gravity Forms installed and activated) will allow you to easily make changes, as needed.

Get MainWP News and Notifications

Sebastian Moran on Github
Sebastian Moran
Sebastian Moran is a WordPress performance expert and technical liaison for MainWP.
Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.