Commit cb66f870 authored by Eric Windham's avatar Eric Windham

Merge branch 'list-option-filters' into 'develop'

Fixed render_options filters that weren't firing in all cases.

See merge request !3838
parents 4770243a cc4e1db7
Pipeline #2664 passed with stages
in 5 minutes and 18 seconds
......@@ -41,7 +41,7 @@ abstract class NF_Abstracts_List extends NF_Abstracts_Field
$settings = $field->get_settings();
$settings[ 'options' ] = apply_filters( 'ninja_forms_render_options', $settings[ 'options' ], $settings );
$settings[ 'options' ] = apply_filters( 'ninja_forms_render_options_' . $field->get_type(), $settings[ 'options' ], $settings );
$settings[ 'options' ] = apply_filters( 'ninja_forms_render_options_' . $field->get_setting( 'type' ), $settings[ 'options' ], $settings );
$options = '<option>--</option>';
if ( is_array( $settings[ 'options' ] ) ) {
......@@ -67,7 +67,7 @@ abstract class NF_Abstracts_List extends NF_Abstracts_Field
$settings = $field->get_settings();
$options = $field->get_setting( 'options' );
$options = apply_filters( 'ninja_forms_render_options', $options, $settings );
$options = apply_filters( 'ninja_forms_render_options_' . $field->get_type(), $options, $settings );
$options = apply_filters( 'ninja_forms_render_options_' . $field->get_setting( 'type' ), $options, $settings );
$output = '';
if( ! empty( $options ) ) {
......
......@@ -37,7 +37,7 @@ class NF_Fields_ListCheckbox extends NF_Abstracts_List
$settings = $field->get_settings();
$options = $field->get_setting( 'options' );
$options = apply_filters( 'ninja_forms_render_options', $options, $settings );
$options = apply_filters( 'ninja_forms_render_options_' . $field->get_type(), $options, $settings );
$options = apply_filters( 'ninja_forms_render_options_' . $this->_type, $options, $settings );
$list = '';
foreach( $options as $option ){
......
......@@ -35,7 +35,7 @@ class NF_Fields_ListCountry extends NF_Abstracts_List
);
add_filter( 'ninja_forms_custom_columns', array( $this, 'custom_columns' ), 10, 2 );
add_filter( 'ninja_forms_render_options_' . $this->_name, array( $this, 'filter_options' ), 10, 2 );
add_filter( 'ninja_forms_render_options_' . $this->_type, array( $this, 'filter_options' ), 10, 2 );
add_filter( 'ninja_forms_subs_export_field_value_' . $this->_name, array( $this, 'filter_csv_value' ), 10, 2 );
}
......@@ -88,7 +88,7 @@ class NF_Fields_ListCountry extends NF_Abstracts_List
$options = $this->get_options();
$options = apply_filters( 'ninja_forms_render_options', $options, $field->get_settings() );
$options = apply_filters( 'ninja_forms_render_options_' . $field->get_type(), $options, $field->get_settings() );
$options = apply_filters( 'ninja_forms_render_options_' . $this->_type, $options, $field->get_settings() );
ob_start();
echo "<select name='fields[$id]'>";
......
......@@ -34,7 +34,7 @@ class NF_Fields_ListMultiselect extends NF_Abstracts_List
$field_options = $field->get_setting( 'options' );
$field_options = apply_filters( 'ninja_forms_render_options', $field_options, $field->get_settings() );
$field_options = apply_filters( 'ninja_forms_render_options_' . $field->get_type(), $field_options, $field->get_settings() );
$field_options = apply_filters( 'ninja_forms_render_options_' . $this->_type, $field_options, $field->get_settings() );
$options = '';
foreach( $field_options as $option ){
......
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