Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Gravity Perks // GP Preview Submission // Hide Hidden-visibility Fields from Preview (when :nohidden modifier is used)
<?php
/**
* Gravity Perks // GP Preview Submission // Hide Hidden-visibility Fields from Preview (when :nohidden modifier is used)
* http://gravitywiz.com
*/
add_filter( 'gform_merge_tag_filter', function( $value, $merge_tag, $modifier, $field ) {
if ( $merge_tag == 'all_fields' ) {
$modifiers = explode( ',', $modifier );
if( in_array( 'nohidden', $modifiers ) && $field->visibility == 'hidden' ) {
return false;
}
}
return $value;
}, 10, 4 );
@rawadm

This comment has been minimized.

Copy link

rawadm commented Dec 14, 2016

Hello where do I insert this code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.