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 Forms 1.9.12.9 and above. Needs the 3rd arg on gform_after_update_entry | |
Compares values from the previous entry to the current (updated) entry, and adds a comment marking the user, time, field, and previous to current values that was changes - one comment per change. | |
*/ | |
function gf_add_note($entry_id, $note){ | |
RGFormsModel::add_note($entry_id, 0, __('gravity Forms'), $note); | |
} | |
add_action( 'gform_after_update_entry', 'magx_add_comment_for_changes_details', 10, 3 ); | |
function magx_add_comment_for_changes_details($form, $entry_id, $original_entry){ | |
$entry = GFAPI::get_entry( $entry_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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-force-default-value.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Force Default Value | |
* | |
* Force the default value to be captured for fields hidden by conditional logic. |
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 Wiz // Gravity Forms // File Generator | |
* | |
* Generate a file on submission which will be processed for merge tags. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.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 Wiz // Gravity Forms // Date Range Display | |
* | |
* Display a group of color-coded date ranges on a calendar based on a GF selected date. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.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 // GP Preview Submission // Adds Support for Gravity Forms Advanced File Uploader | |
* | |
* By default, AFU does not provide any merge tags for displaying the files in Notifications and Confirmations. This | |
* snippet provides these merge tags and also makes them available prior to submission. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ |
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 | |
class RW_GF_Age_Calculation { | |
public function __construct() { | |
add_action( 'init', array( $this, 'init' ) ); | |
} | |
function init() { | |
if ( ! class_exists( 'GFForms' ) || ! property_exists( 'GFForms', 'version' ) && version_compare( GFForms::$version, '1.9', '>=' ) ) { |
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
/* | |
Trigger conditional logic by adding an onclick or onchange event to your custom field input or by using something like the following | |
jQuery('#input_8_1 :input').on('change', function () { | |
gf_apply_rules(8, [2, 3, 4]); | |
}); | |
*/ | |
add_filter( 'gform_pre_render', 'extend_conditional_logic_frontend' ); | |
function extend_conditional_logic_frontend( $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 | |
// format: gform_column_input_content_FORMID_FIELDID_COLUMN | |
add_filter( 'gform_column_input_content_524_2_2', 'change_column_to_checkbox', 10, 6 ); | |
function change_column_to_checkbox( $input, $input_info, $field, $text, $value, $form_id ) { | |
$input_field_name = "input_{$field['id']}[]"; | |
$tabindex = GFCommon::get_tabindex(); | |
$new_input = "<div class='ginput_container'><ul class='gfield_checkbox'>" . | |
"<li><input type='checkbox' {$tabindex} value='First Choice' /><label>First Choice</label></li>" . | |
"<li><input type='checkbox' {$tabindex} value='Second Choice' /><label>Second Choice</label></li>" . | |
"</ul><input type='hidden' name='{$input_field_name}' value='' /></div>"; |