Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Help Scout 30310 Richard Vav
- // exclude field from {all_fields} merge tag by adding
- // :exclude to merge tag
- add_filter( 'gform_merge_tag_filter', 'exclude_from_all_fields', 10, 4 );
- function exclude_from_all_fields ( $value, $merge_tag, $options, $field ) {
- $options_array = explode ( ",", $options );
- $exclude = in_array ( "exclude", $options_array );
- // if a field has the CSS Class Name gf_exclude the field will be excluded from the {all_fields:exclude} merge tag
- if ( $merge_tag == "all_fields" && $exclude == true && $field["cssClass"] == "gf_exclude" )
- return false;
- else
- return $value;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement