This file contains hidden or 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 | |
/** | |
* GP Unique ID // Gravity Perks // Date-specific Sequences | |
* http://gravitywiz.com/ | |
* | |
* Requirements: | |
* - Your form ID cannot be more than 3 digits. | |
* - Your field ID cannot be more than 2 digits. | |
*/ | |
// Update "123" to your form ID. Update "4" to your Unique ID field ID. |
This file contains hidden or 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 // Hourly Cron & Orphaned Entry Expiration | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
function gpnf_custom_hourly_cron() { | |
if( ! is_callable( 'gp_nested_forms' ) ) { | |
return; | |
} |
This file contains hidden or 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 // Conditional Pricing + GravityView // Fix Page Number Validation Conflict | |
* http://gravitywiz.com/documentation/gravity-forms-conditional-pricing/ | |
*/ | |
add_filter( 'gform_pre_validation', function( $form ) { | |
if( is_callable( 'gravityview' ) && gravityview()->request->is_edit_entry() !== false ) { | |
foreach( $form['fields'] as &$field ) { | |
$field->pageNumber = 1; | |
} |
This file contains hidden or 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 // Limit Submissions // Value-specific Limits by Field | |
* http://gravitywiz.com/documentation/gravity-forms-limit-submissions/ | |
* | |
* Form Export: https://gwiz.io/2Nm2JC2 | |
* Feed Config: https://gwiz.io/2GJ2mRV | |
*/ | |
// Update "123" to your form ID. | |
add_filter( 'gpls_rule_groups_123', function( $groups ) { |
This file contains hidden or 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 // eCommerce Fields // Consolidate Separate Discount Line Items into a Single Discounts Line Item | |
* http://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/ | |
* | |
* Default: https://gwiz.io/2IiPALf | |
* w/ Snippet: https://gwiz.io/2Itfyfo | |
*/ | |
// Update "123" to your form ID - or - remove "_123" to apply to all forms. | |
add_filter( 'gpecf_order_summary_123', function( $summary ) { |
This file contains hidden or 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 // Limit Dates // Disable All Dates & Set Enabled Dates via Exceptions | |
* http://gravitywiz.com/documentation/gravity-forms-limit-dates/ | |
*/ | |
add_filter( 'gpld_limit_dates_options_123_1', function( $options, $form, $field ) { | |
$options['exceptionMode'] = 'enable'; | |
$options['disableAll'] = true; |
This file contains hidden or 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 // Re-order Display Fields | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
// Update "123" to your form ID. | |
add_filter( 'gform_pre_render_123', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// Update "2" to your Nested Form field ID. | |
if( $field->id = 2 ) { |
This file contains hidden or 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 // Conditional Logic Dates // Fix Conflict w/ WC GF Product Add-ons | |
* http://gravitywiz.com/documentation/gravity-forms-conditional-logic-dates/ | |
*/ | |
add_filter( 'woocommerce_get_cart_item_from_session', function( $return ) { | |
add_filter( 'gform_form_post_get_meta', function( $form ) { | |
if( class_exists( 'GP_Conditional_Logic_Dates' ) ) { | |
$form = GP_Conditional_Logic_Dates::$instance->modify_frontend_form_object( $form ); | |
} |
This file contains hidden or 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 // Copy Parent Entry Properties on Parent Form Submission | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
// Update "123" to your parent form ID. | |
add_action( 'gform_entry_created_123', function( $entry, $form ) { | |
// Specify which properties you would like to populate from the parent. | |
// Supports: id, form_id, post_id, date_created, is_starred, is_read, ip, source_url, user_agent, currency, payment_status, payment_date, payment_amount, payment_method, transaction_id, is_fulfilled, created_by, transaction_type, status, date_updated, last_payment_date |
This file contains hidden or 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 // Force {Parent} Merge Tag Replacement on Submission | |
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/ | |
*/ | |
add_filter( 'gform_entry_post_save', function( $entry, $form ) { | |
foreach( $form['fields'] as &$field ) { | |
if( $field->get_input_type() == 'form' ) { | |
$child_form_id = $field->gpnfForm; |