Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Gravity Perks // Populate Anything // Populate Pipe Video URL
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* By default, when populating a Pipe field's value, the Pipe add-on returns an array which includes the video URL and a thumbnail.
* This snippet allows you to just populate the video URL.
* Just add the "gppa-pipe-video" CSS class to the populated field's CSS Class Name setting.
*/
add_filter( 'gppa_process_template_value', function( $template_value, $field ) {
<?php
/**
* Gravity Perks // GP Nested Forms // Ignore the first `n` child entries with `:count` merge tag modifier
* https://gravitywiz.com/documentation/gravity-forms-nested-forms
*
* Also works with `:total` merge tag modifier
*
* Instructions:
*
* 1. Install this snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
/**
* Gravity Perks // GP Nested Forms // Ignore the first `n` child entries with `:count` merge tag modifier
* https://gravitywiz.com/documentation/gravity-forms-nested-forms
*
* Also works with `:total` merge tag modifier
*
* Instructions:
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
<?php
/**
* Gravity Perks // GP Google Sheets // Admin Columns Pro Inline Edit Compatability
*
* Allow the Google Sheet to be updated after the entry is edited by Admin Columns Pro Inline Edit
*
* Installation:
* 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
*/
add_action( 'acp/editing/saved', function ( AC\Column $column, $id ) {
<?php
/**
* Gravity Perks // Populate Anything // Range Modifier for Live Merge Tags
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* Use the :range modifier with checkbox merge tags to get the range of checked options
* Works well with the :value modifier
*
* Will return `x - y` where the min and max are different, or `x` if they are the same
<?php
/**
* Gravity Perks // GF Better User Activation // Set Redirect URL by User Role
* http://gravitywiz.com/documentation/gravity-forms-better-user-activation/
*/
add_filter( 'gpbua_activation_redirect_url', function( $url, $activation ) {
// Enter the roles and redirect URLs
$redirects = array(
'subscriber' => 'https://google.com',
<?php
/**
* Gravity Perks // Populate Anything // Populate JetSloth with ACF Image Field
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* Instructions:
*
* 1. Go to the field settings for the Gravity Forms choice field you are populating.
* 3. Add "gppa-jetsloth-acf-image" to the "Custom CSS Class" setting (on the Appearance tab).
*
<?php
/**
* Gravity Shop // GS Product Configurator // Don't Delay User Registration Feed
*
* Instructions:
* 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
*/
add_filter( 'gspc_delay_feed_processing', function( $delay, $form, $entry, $slug, $payment_feed ){
if( $slug === 'gravityformsuserregistration' ){
<?php
/**
* Gravity Perks // Address Autocomplete // Update GravityView Geocoder with coordinates
* https://gravitywiz.com/documentation/gravity-forms-address-autocomplete/
*/
// Replace 123 with your form ID
add_action( 'gform_after_submission_123', function ( $entry, $form ){
$address_field_id = 4; // Replace 4 with your address field ID
$lat_field_id = 6; // Replace 6 with your latitude field ID
<?php
/**
* Gravity Perks // Notification Scheduler // Custom Repeat Schedule
* https://gravitywiz.com/documentation/gravity-forms-notification-scheduler/
*/
add_filter( 'gpns_schedule_timestamp', function ( $timestamp, $notification, $entry, $is_recurring, $current_time ) {
// Update "123" to the form ID.
$form_id = 123;