From 2b6d3a8cf3ce947fbf447dfeb8dd0e1c1a04eaad Mon Sep 17 00:00:00 2001 From: denisbaranov Date: Fri, 7 Sep 2018 17:05:51 +0300 Subject: [PATCH] Filter to Enable options pair for Select fields --- includes/core/class-fields.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 81d793e4..4d1286ad 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -2369,7 +2369,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= $this->field_error( $this->show_error( $key ) ); } $output .= ''; - + break; /* Select dropdown */ @@ -2581,6 +2581,18 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $field_value = ''; + /** + * UM hook + * + * @type filter + * @title um_select_option_value + * @description Enable options pair by field $data + * @input_vars + * [{"var":"$options_pair","type":"null","desc":"Enable pairs"}, + * {"var":"$data","type":"array","desc":"Field Data"}] + */ + $options_pair = apply_filters( "um_select_options_pair", null, $data ); + // switch options pair for custom options from a callback function if ( ! empty( $data['custom_dropdown_options_source'] ) ) { $options_pair = true;