diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php index 687e940a..0a1ae353 100644 --- a/includes/core/class-fields.php +++ b/includes/core/class-fields.php @@ -3235,13 +3235,15 @@ if ( ! class_exists( 'um\core\Fields' ) ) { /** * Filters enable options pair by field $data. * - * @since 2.0 + * @since 1.3.x `um_multiselect_option_value` + * @since 2.0 renamed to `um_select_options_pair` + * * @hook um_select_options_pair * * @param {bool|null} $options_pair Enable pairs. * @param {array} $data Field Data. * - * @return {bool} Enable pairs. + * @return {bool} Enable pairs. Set to `true` if a field requires text keys. * * @example Enable options pair. * function my_um_select_options_pair( $options_pair, $data ) { @@ -3334,28 +3336,6 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= $this->field_label( $data['label'], $key, $data ); } - /** - * Filters multiselect keyword data. - * - * @since 1.3.x - * @hook um_multiselect_option_value - * - * @param {int} $keyword If 1 - keyword is enabled. It's 0 by default. - * @param {string} $type Field type. Deprecated since 2.6.7 - * @param {array} $data Field data. Added since 2.6.7 - * - * @return {int} Enabled keyword. - * - * @example Change multiselect keyword data. Enable it. - * function my_multiselect_option_value( $keyword, $data ) { - * // your code here - * $keyword = 1; - * return $keyword; - * } - * add_filter( 'um_multiselect_option_value', 'my_multiselect_option_value', 10, 2 ); - */ - $use_keyword = apply_filters( 'um_multiselect_option_value', 0, $data ); - $has_icon = ! empty( $data['icon'] ) && isset( $this->field_icons ) && 'field' === $this->field_icons; $output .= '
'; @@ -3363,7 +3343,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) { $output .= '
'; } - $output .= ''; if ( isset( $options ) && 'builtin' === $options ) { $options = UM()->builtin()->get( $data['filter'] ); diff --git a/includes/core/class-member-directory.php b/includes/core/class-member-directory.php index 3d8211cc..422e2f23 100644 --- a/includes/core/class-member-directory.php +++ b/includes/core/class-member-directory.php @@ -676,16 +676,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) { $attrs['options'] = UM()->fields()->get_options_from_callback( $attrs, $attrs['type'] ); } else { - /** - * 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"}] - */ + /** This filter is documented in includes/core/class-fields.php */ $option_pairs = apply_filters( 'um_select_options_pair', null, $attrs ); } diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index 12101d31..e646f8cd 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -824,16 +824,7 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) { } } elseif ( 'select' == $type || 'radio' == $type ) { - /** - * 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"}] - */ + /** This filter is documented in includes/core/class-fields.php */ $option_pairs = apply_filters( 'um_select_options_pair', null, $data ); $array = empty( $data['options'] ) ? array() : $data['options']; @@ -859,16 +850,7 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) { } elseif ( ! empty( $value ) && is_array( $value ) ) { if ( 'multiselect' == $type || 'checkbox' == $type ) { - /** - * 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"}] - */ + /** This filter is documented in includes/core/class-fields.php */ $option_pairs = apply_filters( 'um_select_options_pair', null, $data ); $arr = $data['options'];