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.
Add settings in the field-specific section in field options.
Usage
add_action( 'frm_field_options', 'my_custom_function' );
Parameters
- $args (array)
- 'field' (array)
- 'display' (array) - A list of field options that should be shown for the current field.
- 'values' (array) - Details about the form.
Examples
Include padding settings
This example will include padding settings for the input text type fields.
add_action( 'frm_field_options', 'my_custom_function' );
function my_custom_function( $args ) {
$display = $args['display'];
$field = $args['field'];
$is_text_input = FrmField::is_field_type( $field, 'text' ); // replace 'text' with the type of the field you need to evaluate - for example: radio, checkbox
if ( $display['type'] == 'text' || $is_text_input ) { // replace 'text' with the type of the field you need to modify - for example: radio, checkbox
include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/padding.php'; //replace this path with the correct one where your file is located
}
}
In our Public GitHub Repository you can find several examples of what the html of the field settings would be like
Change Log
Added in version 4.0