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 | |
| add_action( 'gpeb_edit_entry', function( $entry, $form ) { | |
| // Update to your form_id and field_id | |
| $form_id = 1; | |
| $field_id = 4; | |
| $meta_key = 'gallery_test'; | |
| global $wpdb; | |
| if ( $form['id'] != $form_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
| window.gform.addAction('gpfup_before_upload', (formId, fieldId, file, up, gpfupInstance) => { | |
| // Define allowed aspect ratios | |
| const allowedAspectRatios = [ | |
| 16 / 9, // 16:9 | |
| 9 / 16, // 9:16 | |
| 1 / 3, // 1:3 | |
| 3 / 1 // 3:1 | |
| ]; | |
| // Define allowed video MIME types |
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 Perks // File Upload Pro // Limit Duration of MP4/MOV Files - Apply different limit to different different fields. | |
| * https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/ | |
| * | |
| * Instructions: | |
| * 1. Install our free Custom Javascript for Gravity Forms plugin. | |
| * Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/ | |
| * 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin. | |
| * | |
| * Demo: https://www.loom.com/share/9d72eea07e944f69bce5d3377b478a48 |
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 GW_GPAPF_Formatting { | |
| private $_args = array(); | |
| public function __construct( $args = array() ) { | |
| $this->_args = wp_parse_args( $args, array( | |
| 'form_id' => false, | |
| 'field_id' => false, |
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.addAction( 'gform_input_change', function( elem, formId, fieldId ) { | |
| if (formId != GFFORMID && fieldId != '1') { // REPLACE 1 with your field id | |
| return; | |
| } | |
| let value = $(elem).val(); | |
| if (value.length >= 2 && value.charAt(0) !== '0') { | |
| value = '0' + value; | |
| } | |
| if (value.length >= 12 && value.charAt(0) === '0') { | |
| value = value.substring(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 | |
| // REPLACE "123" to the ID of your Form | |
| add_action( 'gform_pre_submission_123', 'gw_capitalize_submitted_data' ); | |
| function gw_capitalize_submitted_data( $form ) { | |
| $applicable_input_types = array( 'address', 'text', 'textarea', 'name', 'list' ); | |
| // REPLACE 9 with the List Field ID you intend to capitalize data for. | |
| $target_list_field_id = 9; | |
| foreach ( $form['fields'] as $field ) { |
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 | |
| add_filter( 'gppa_object_type_query', function ( $query_builder_args, $args ) { | |
| global $wpdb; | |
| if ( ! wp_doing_ajax() || rgar( $_REQUEST, 'action' ) !== 'gp_advanced_select_get_gppa_results' ) { | |
| return $query_builder_args; | |
| } |
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
| $(document).ready(function() { | |
| var streamFieldId = 3; | |
| var promptFieldId = 1; | |
| var responseFieldId = 4; | |
| var appendButtonFieldId = responseFieldId; | |
| var $streamFieldInput = $(`#input_GFFORMID_${streamFieldId}`); | |
| var $streamButton = $streamFieldInput.closest('.gfield').find('.gcoai-trigger'); | |
| var $promptInput = $(`#input_GFFORMID_${promptFieldId}`); | |
| var $newButton = $streamButton.clone() |
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 | |
| var streamFieldId = 3; | |
| var promptFieldId = 1; | |
| var responseFieldId = 4; | |
| var appendButtonFieldId = responseFieldId; | |
| var $streamFieldInput = $(`#input_GFFORMID_${streamFieldId}`); | |
| var $streamButton = $streamFieldInput.closest('.gfield').find('.gcoai-trigger'); | |
| $streamFieldInput.on('change', function() { |
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 Wiz // Gravity Forms // Update Posts (Customized with POST ID) | |
| * https://gravitywiz.com/how-to-update-posts-with-gravity-forms/ | |
| * | |
| * Update existing post title, content, author and custom fields with values from Gravity Forms. | |
| * | |
| * @version 0.6 | |
| * @author Scott Ryer <[email protected]> | |
| * @license GPL-2.0+ |