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 | |
| // Original filter to optimize the query using caching | |
| add_filter('gpeb_filters_col_rows_query', 'custom_optimize_gf_entry_meta_query_with_cache', 10, 3); | |
| function custom_optimize_gf_entry_meta_query_with_cache($sql, $col, $table) { | |
| // Check if the current table and column are the ones we want to optimize | |
| if ($table === GFFormsModel::get_entry_meta_table_name() && $col === 'meta_key') { | |
| // Attempt to retrieve cached meta_key results | |
| $cached_meta_keys = get_transient('gf_entry_meta_keys'); |
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
| window.gform.addFilter( 'gpfup_meets_minimum_requirement', function ( meetsMinimum, imageSize, formId, fieldId, GPFUP ) { | |
| if ( imageSize.width == GPFUP.minWidth && imageSize.height == GPFUP.minHeight ) { | |
| return true; | |
| } | |
| return false; | |
| } ); | |
| window.gform.addFilter( 'gpfup_strings', function( strings, formId, fieldId ) { | |
| // REPLACE 1 with the field id of your File Upload Pro field | |
| if ( formId != GFFORMID && fieldId == 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 | |
| /** | |
| * Filter the Graivyt Wiz Inventry limit to set it via custom field value | |
| */ | |
| add_filter( 'gpi_inventory_limit_advanced', 'cf_custom_inventory_limit' ); | |
| function cf_custom_inventory_limit( $limit ) { | |
| $queried_object_id = get_queried_object_id(); | |
| if ( $queried_object_id == 0 ) { | |
| $queried_object_id = get_transient( 'backup_queried_object_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 | |
| class GPNF_Triggered_Population { | |
| private $_args = array(); | |
| public function __construct( $args = array() ) { | |
| // set our default arguments, parse against the provided arguments, and store for use throughout the class | |
| $this->_args = wp_parse_args( $args, array( | |
| 'form_id' => 0, |
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 | |
| class GPNF_Triggered_Population { | |
| private $_args = array(); | |
| public function __construct( $args = array() ) { | |
| // set our default arguments, parse against the provided arguments, and store for use throughout the class | |
| $this->_args = wp_parse_args( $args, array( | |
| 'form_id' => 0, |
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
| /** | |
| * Gravity Wiz // Gravity Forms // "None of the Above" Checkbox | |
| * https://gravitywiz.com/ | |
| * | |
| * Instruction Video: https://www.loom.com/share/0f8de708790b4afd879bf0632efd7eae (Out of date) | |
| * | |
| * Use this snippet to enable a proper "None of the Above" option in your Checkbox fields. If any | |
| * other option is checked, the "None of the Above" option will be disabled. If the "None of the Above" | |
| * option is checked, all other options will be disabled. | |
| * |
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
| $( '.gw-none-of-the-above' ).each( function() { | |
| var disable_nota = false; | |
| var $field = $( this ); | |
| var $nota = $field.find('input[type="checkbox"]').filter(function() { | |
| return $(this).val().toLowerCase() === 'none of the above'; | |
| }); | |
| var $others = $field.find( 'input' ).not( $nota ); | |
| // If "None of the Above" choice is checked by default. |
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
| gform.addFilter( 'gpcc_copied_value', function( value, targetElem, data ) { | |
| $source = jQuery( '#input_' + data.sourceFormId + '_' + data.source ); | |
| if( $source.is( '.gfield_radio' ) ) { | |
| value = $source.find( '.gfield-choice-input:checked + label' ).text(); | |
| } else { | |
| return value; | |
| } | |
| var label = targetElem.next('label'); |
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
| // Update field IDs | |
| const startDateField = document.getElementById('input_GFFORMID_1'); | |
| const endDateField = document.getElementById('input_GFFORMID_3'); | |
| const countField = document.getElementById('input_GFFORMID_6'); | |
| function parseDateString(dateString) { | |
| const parts = dateString.split('/'); | |
| const day = parseInt(parts[0], 10); | |
| const month = parseInt(parts[1], 10) - 1; | |
| const year = parseInt(parts[2], 10); |