Commit 3387d97e authored by Kyle B. Johnson's avatar Kyle B. Johnson Committed by Kevin Stover

move ninja_forms_default_value filter outside of value check. (#2133)

parent 8e517c15
......@@ -233,8 +233,9 @@ final class NF_Display_Render
$settings[ 'options' ] = apply_filters( 'ninja_forms_render_options_' . $field_type, $settings[ 'options' ], $settings );
}
if (isset($settings['default'])) {
$default_value = apply_filters('ninja_forms_render_default_value', $settings['default'], $field_type, $settings);
$default_value = ( isset( $settings[ 'default' ] ) ) ? $settings[ 'default' ] : null;
$default_value = apply_filters('ninja_forms_render_default_value', $default_value, $field_type, $settings);
if ( $default_value ) {
$default_value = preg_replace( '/{.*}/', '', $default_value );
......@@ -427,8 +428,9 @@ final class NF_Display_Render
$field['settings'][ 'options' ] = apply_filters( 'ninja_forms_render_options_' . $field['settings'][ 'type' ], $field['settings'][ 'options' ], $field['settings'] );
}
if (isset($field['settings']['default'])) {
$default_value = apply_filters('ninja_forms_render_default_value', $field['settings']['default'], $field_type, $field['settings']);
$default_value = ( isset( $field[ 'settings' ][ 'default' ] ) ) ? $field[ 'settings' ][ 'default' ] : null;
$default_value = apply_filters( 'ninja_forms_render_default_value', $default_value, $field_type, $field[ 'settings' ]);
if( $default_value ){
$default_value = preg_replace( '/{.*}/', '', $default_value );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment