Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_default_value_setting

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.

Add extra settings in the 'Default Value' section in the field settings.

Usage

add_action( 'frm_default_value_setting', 'add_custom_field_setting' );
function add_custom_field_setting( $args )

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Parameters

  • $args (array)
    • 'field' (array)
    • 'display' (array): A list of field options that should be shown for the current field.
    • 'default_value_types' (array) The types of default values this field allows.

Examples

Add a custom setting below the default value setting

In this code example, the custom setting will be displayed below the default value option when a star field type is selected.

add_action( 'frm_default_value_setting', 'after_default_value_setting' );
function after_default_value_setting( $args ) {
	$field = $args['field'];
	$value = isset( $field['default_value'] ) ? $field['default_value'] : '';
	if ( 'star' === $field['type'] ) {
		?>
		<label>
			<input type="checkbox" value="1" name="field_options[custom_setting_<?php checked( $value, 1 ); ?>]" />
			<?php esc_html_e( 'Custom setting', 'text-domain' ); ?>
		</label>
		<?php
	}
}

Change Log

Added in version 4.0

Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms