From 2b05999bd22e305f76bd117caec10203440c2352 Mon Sep 17 00:00:00 2001 From: yuriinalivaiko Date: Sun, 22 Oct 2023 19:09:53 +0300 Subject: [PATCH] - the field label changed from "Birth Date" to "Age" in the directory and in the profile view. --- includes/core/um-filters-fields.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index fcfa3679..1ece154d 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -1003,3 +1003,21 @@ function um_edit_url_field_value( $value, $key ) { return $value; } add_filter( 'um_edit_url_field_value', 'um_edit_url_field_value', 10, 2 ); + + +/** + * Change field label from "Birth Date" to "Age" in the directory and in the profile view. + * + * @param string $label Field Label. + * @param string $key Field Key. + * + * @return string + */ +function um_view_label_birth_date( $label, $key = 'birth_date' ) { + if ( 'birth_date' === $key ) { + $label = __( 'Age', 'ultimate-member' ); + } + return $label; +} +add_filter( 'um_view_label_birth_date', 'um_view_label_birth_date', 10, 1 ); +add_filter( 'um_change_field_label', 'um_view_label_birth_date', 10, 2 );