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 hook allows you to modify the list of fields in the Customization panel tags box.
Usage
add_filter( 'frm_fields_in_tags_box', 'my_custom_function');
Parameters
- $fields (array): The list of fields.
- $args (array): Include form_id.
Examples
Remove all Likert fields from the tags box
You can use the following example to remove all Likert fields from the Customization panel tags box.
add_filter( 'frm_fields_in_tags_box', 'remove_likert_tags_box', 10, 2);
function remove_likert_tags_box( $fields, $args ) {
if ( 13 != $args['form_id'] ) {
return $fields; // Do not modify fields if this is not the form you want.
}
// Remove all Likert fields.
foreach ( $fields as $index => $field ) {
$field = (object) $field;
if ( 'likert' === $field->type ) {
unset( $fields[ $index ] );
}
}
return $fields;
}