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 // Prevent Form from Being Updated | |
* http://gravitywiz.com | |
*/ | |
add_action( 'check_admin_referer', function( $action, $result ) { | |
// update the "723" to your form ID | |
if( $action == 'gforms_update_form_723' ) { | |
die( 'Back up off my form, BRO!' ); | |
} |
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 // Require Unique Values Between Fields | |
* | |
* Allows you to require two or more fields on the same form to be different from each other. For example, if you are | |
* collecting a personal phone number and an emergency contact phone number, this functionality can be used to ensure | |
* that the same number is not used for both fields. | |
* | |
* @version 1.1 | |
* @author David Smith <[email protected]> |
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 // Exclude Forms from Form List | |
* http://gravitywiz.com | |
*/ | |
add_filter( 'query', function( $query ) { | |
if( rgget( 'page' ) != 'gf_edit_forms' ) { | |
return $query; | |
} |
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 // Fill Gaps in Sequential Unique IDs | |
* http://gravitywiz.com/documentation/gp-unique-id/ | |
* | |
* Use this snippet to automatically fill gaps in the sequence of unique IDs for Unique ID fields of the "Sequential" | |
* type. Gaps will occur when entries containing a sequential unique ID are deleted. | |
* | |
* Update the filter name "gpui_sequential_unique_id_pre_insert_519_5", replacing "519" with your form ID and "5" with | |
* your 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 Wiz // GP Unique ID // Share a global unique ID across all forms | |
*/ | |
add_filter( 'gpui_unique_id_attributes', 'gwiz_global_unique_id', 10, 3 ); | |
function gwiz_global_unique_id( $atts, $form_id, $field_id ) { | |
if( $atts['type'] != 'sequential' ) { | |
$atts['form_id'] = 1; | |
$atts['field_id'] = 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 | |
/** | |
* GP Unique ID // Gravity Perks // Change Input Type to Text | |
* http://gravitywiz.com/documentation/gp-unique-id/ | |
* | |
* Updates the input HTML from "hidden" (default) to "text". | |
*/ | |
add_filter( 'gpui_input_html_options', function ( $options ) { | |
if( rgget( 'view' ) == 'entry' && rgget( 'edit' ) ) { | |
$options['input_type'] = 'text'; |
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 // Editable Input for Gravity View | |
* http://gravitywiz.com/documentation/gp-unique-id/ | |
* | |
* Updates the input HTML from "hidden" (default) to "text" when viewing entry via Gravity View edit view. | |
*/ | |
if( function_exists( 'gp_unique_id' ) ) { | |
add_filter( 'gpui_input_html_options', function ( $options ) { |
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 // Populate Field from One Page to Field in Subsequent Page | |
* http://gravitywiz.com/ | |
*/ | |
// update "1074" to the ID of your form | |
add_filter( 'gform_pre_render_1074', function( $form ) { | |
foreach( $form['fields'] as &$field ) { | |
// update "2" to the field ID on the later page |
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 | |
/** | |
* Craig Udit // Gravity Forms // Value Assignment | |
* | |
* Populate a value into a field by a list of conditions provided via CSV. | |
* | |
* @version 1.0 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/... |