This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // Populate Anything // LMT Extract First Letter | |
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/ | |
* | |
* Extract the first letter of a string using a Live Merge Tag | |
*/ | |
// Update "123" to your form ID; and "4" to the field ID you are copying from. | |
add_filter( 'gppa_live_merge_tag_value_123_4', function( $value ) { | |
return substr( $value, 0, 1 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gravity Perks // Nested Forms // Copy Parent Values To First Child Entry | |
* https://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
* | |
* Copy parent values into the first child entry automatically. The `{Parent}` merge tag would typically be used | |
* for this but this would copy the values to all child entries, not just the first. | |
*/ | |
gform.addAction( 'gpnf_init_nested_form', function( childFormId, gpnf ) { | |
// Update "123" to your the ID of your child form. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gravity Perks // Nested Forms // Add `Required` label to Nested Form field | |
* https://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
* | |
* Adds a `Required` label to a Nested Form field when a minimum child entry limit is set. | |
*/ | |
// Replace `123` with your form ID and `4` with your Nested Form field ID | |
add_filter( 'gform_field_content_123_4', function ( $content, $field, $value, $lead_id, $form_id ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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). | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ) { |
NewerOlder