Skip to content

Instantly share code, notes, and snippets.

@jorpdesigns
Created July 14, 2021 19:51
Show Gist options
  • Save jorpdesigns/0f270bbe78874e3df0861fef6d5c09d4 to your computer and use it in GitHub Desktop.
Save jorpdesigns/0f270bbe78874e3df0861fef6d5c09d4 to your computer and use it in GitHub Desktop.
Snippet to exclude Gravity Forms hidden field from "all_fields" merge tag
<?php
add_filter( 'gform_merge_tag_filter', 'filter_all_fields', 10, 6 );
function filter_all_fields( $value, $merge_tag, $modifier, $field, $raw_value, $format ) {
if ( $merge_tag == 'all_fields' && $field->type == 'hidden' && $field->id == '10' ) { // Replace 10 with your hidden field id
return false;
} else {
return $value;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment