Docs & Support

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

frm_[type]_primary_field_options

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.

Replace [type] in the hook with the name of the field type. This adds settings into the field-specific section in the field settings.

Usage

add_action( 'frm_radio_primary_field_options', 'add_custom_field_settings' );
function add_custom_field_settings( $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.
    • values (array): Details about the form.

Examples

Add custom setting to text field options

This code example doesn't handle saving the value. To properly store this setting, register it in the default options array using the frm_default_field_options filter or create your own saving handler

add_action( 'frm_text_primary_field_options', 'custom_field_settings' );
function custom_field_settings( $args ) {
	$field = $args['field'];
	$custom_setting = isset( $field['custom_setting'] ) ? $field['custom_setting'] : '';
	?>
	<p>
		<label for="custom-setting-<?php echo intval( $field['id'] ); ?>">
			<?php esc_html_e( 'Custom setting', 'text-domain' ); ?>
		</label>
		<input type="text" id="custom-setting-<?php echo intval( $field['id'] ); ?>" name="field_options[custom_setting_<?php echo intval( $field['id'] ); ?>]" value="<?php echo esc_attr( $custom_setting ); ?>" />
	</p>
	<?php
}

add_filter( 'frm_default_field_options', 'add_custom_field_option', 10, 2 );
function add_custom_field_option( $options, $args ) {
	if ( 'text' === $args['type'] ) {
		$options['custom_setting'] = '';
	}
	return $options;
}
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