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 modifying the list of fields in the form.
Usage
add_filter('frm_fields_in_form', 'my_custom_function', 10, 2);
Parameters
- $fields (array): The list of fields.
- $args (array): Includes form.
Examples
Remove all Likert fields from a form
add_filter('frm_fields_in_form', 'frm_remove_likert_in_form', 10, 2);
function frm_remove_likert_in_form( $fields, $args ) {
if ( 13 == $args['form']->id ) { //Replace 13 with the ID of your field
foreach ( $fields as $index => $field ) {
if ( 'likert' == $field['type'] ) {
unset( $fields[ $index ] );
}
}
}
return $fields;
}