Settings Configuration

Settings for Actions and Fields are stored as arrays. Each setting should be a sub-array of the class’ $_settings property.

Example:

/*
* Settings
*/
$this->_settings = array(
'label' => array(
'name' => 'label',
'type' => 'textbox',
'label' => __( 'Label', 'ninja-forms'),
'width' => 'one-half',
'group' => 'primary',
'value' => '',
'help' => __( 'Enter the label of the form field.', 'ninja-forms' ),
),
)

Settings Properties

Name

REQUIRED: The name property is used as a unique identifier and should match the setting array key.

Type

REQUIRED: The type property is used for template display purposed, similar to fields types, but for settings in the builder.

Basic type values include: ‘textbox’, ‘textarea’, ‘select’, ‘number’,’toggle’

Label

REQUIRED: The label property is displayed to identify the setting in the settings drawer.

The value of the label property should be a translatable string.

Group

REQUIRED: The group property, is used to organize settings within the drawer, similar to sections.

Supported group values include: ‘primary’, ‘restrictions’, ‘advanced’, ‘administration’

Custom Groups can be added using the filter hook ninja_forms_field_settings_groups [link to codex needed].

Width

OPTIONAL: The width property is used to determine layout within the settings drawer.

Supported width values include: ‘full’ (default), ‘one-half’, ‘one-third’

Value

OPTIONAL: The value property is used as a default value for the setting.

Help Text

OPTIONAL: The help property is used to display a tooltip with additional help text.

The value of the help property should be a translatable string.

Note: The tooltip will only display if the help property is defined.

Advanced Setting Configurations

Options

The options property is used to populated the options list for a select field type.

Each options array item should contain both a label key and a value key.

The value of each options label should be a translatable string.

Input Masks

The mask property is used to define an Input Mask for a setting field.

Supported mask values include: ‘numeric’, ‘currency’, ‘custom’.

Dependencies

The deps property is used to declare display dependencies based on other setting values.

Each deps array item should contain a setting => value key pair.

If all conditions are not met, then the parent setting will not be displayed.

Merge Tag Support

The use_merge_tags property is used to declare support for merge tag values.

When set, the setting field will contain an icon link for adding merge tags to a setting’s value.

Supported use_merge_tags values include: TRUE, FALSE, ‘include’, ‘exclude’.

While TRUE declares general support for merge tags, specific support can be declared with include and exclude.

To specifically support a merge tag group, set the group as an array item of include.

To specifically not support a merge tag group, set the group as an array item of exclude.

Supported merge tag groups include: ‘fields’, ‘user’, ‘post’, ‘system’, ‘calculations’.

Settings

The settings property is a special property used with the fieldset setting type.

Each settings array item is a setting with properties, grouped in an HTML fieldset.

Columns

The columns property is a special property used with the option-repeater setting type.

Each columns array item should contain both a header key and a default key.

The array key for each columns array item should be a unique string.

The value of each columns header should be a translatable string.

Notes of specific setting properties

Fieldset Type

The fieldset field type is a special setting that includes multiple other settings.

Each settings array item is a setting with properties, grouped in an HTML fieldset.