Use Unique ID Field in Conditional Logic

Code

Filename: gpuid-use-uid-field-in-conditional-logic.php

<?php
/**
 * Gravity Perks // Unique ID // Use Unique ID Field in Conditional Logic
 * https://gravitywiz.com/documentation/gravity-forms-unique-id/
 */
add_action( 'admin_footer', function() {
	if ( wp_script_is( 'gform_form_admin' ) && GFForms::get_page() !== 'form_editor' ) :
		?>
		<script>
			gform.addFilter( 'gform_is_conditional_logic_field', function( isConditionalLogicField, field ) {
				return isConditionalLogicField || field.type === 'uid';
			} );
		</script>
		<?php
	endif;
} );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.