Filter to Enable options pair for Select fields

This commit is contained in:
denisbaranov
2018-09-07 17:05:51 +03:00
parent da43ae19ae
commit 2b6d3a8cf3
+13 -1
View File
@@ -2369,7 +2369,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
$output .= $this->field_error( $this->show_error( $key ) );
}
$output .= '</div>';
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;