Heads up!
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.
This filter allows you to change the fields that are included in a summary field.
Usage
add_filter( 'frm_pro_fields_in_summary_values', 'exclude_field_from_summary', 10, 2 );
Parameters
- $fields (array): The list of fields.
- $args (array): Includes form_id.
Examples
Exclude a specific field from a summary field
add_filter( 'frm_pro_fields_in_summary_values', 'exclude_field_from_summary', 10, 2 );
function exclude_field_from_summary( $fields, $args ) {
$target_form_id = 302; // Replace 302 with ID of your form
if ( $target_form_id !== (int) $args['form_id'] ) {
return $fields;
}
$field_id_to_remove = 1460; // Replace 1460 with ID of your field
foreach ( $fields as $key => $field ) {
if ( (int) $field->id === $field_id_to_remove ) {
unset( $fields[ $key ] );
return $fields;
}
}
return $fields;
}