Field Value

Render Default Value

Example: add_filter( ‘ninja_forms_render_default_value’, ‘callback’, 10, 3 );

Arguments:

  • string $default_value
  • obj $field_class
  • array $field_settings

For List Field Types, the default selected options need to be marked specifically.

add_filter( ‘ninja_forms_render_options’, ‘callback’, 10, 2 );

add_filter( ‘ninja_forms_render_options_{$type}, ‘callback’, 10, 2 );

Arguments:

  • array $options
  • array $settings
<?php
add_filter( 'ninja_forms_render_options', 'my_ninja_forms_render_options', 10, 2 );
function my_ninja_forms_render_options( $options, $settings ){
foreach( $options as &$option ){
if( 'three' == $option[ 'value' ] ){
$option[ 'selected' ] = 1;
}
}
return $options;
}