From 170b41ff7084c490f09af82d210361465f4599c3 Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Mon, 13 Jan 2020 16:26:43 +0200 Subject: [PATCH] - fixed um_convert_tags for array values; --- includes/um-short-functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 555aa3ec..37d83500 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -209,8 +209,12 @@ function um_convert_tags( $content, $args = array(), $with_kses = true ) { // Support for all usermeta keys if ( ! empty( $matches[1] ) && is_array( $matches[1] ) ) { foreach ( $matches[1] as $match ) { - $strip_key = str_replace( 'usermeta:', '', $match ); - $content = str_replace( '{' . $match . '}', um_user( $strip_key ), $content ); + $key = str_replace( 'usermeta:', '', $match ); + $value = um_user( $key ); + if ( is_array( $value ) ) { + $value = implode( ', ', $value ); + } + $content = str_replace( '{' . $match . '}', apply_filters( 'um_convert_tags', $value, $key ), $content ); } } return $content;