diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 55f183e5..bffc9d61 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -120,6 +120,17 @@ $content = str_replace($args['tags'], $args['tags_replace'], $content); } + $regex = '~\{([^}]*)\}~'; + preg_match_all($regex, $content, $matches); + + // Support for all usermeta keys + if ( isset( $matches[1] ) && is_array( $matches[1] ) && !empty( $matches[1] ) ) { + foreach( $matches[1] as $match ) { + $strip_key = str_replace('usermeta:','', $match ); + $content = str_replace( '{' . $match . '}', um_user( $strip_key ), $content); + } + } + return $content; } diff --git a/core/um-shortcodes.php b/core/um-shortcodes.php index c0d681e7..b5ca4195 100644 --- a/core/um-shortcodes.php +++ b/core/um-shortcodes.php @@ -192,7 +192,7 @@ class UM_Shortcodes { $args = wp_parse_args( $args, $defaults ); - $args['lock_text'] = $this->convert_locker_tags( $args['lock_text'] ); + //$args['lock_text'] = $this->convert_locker_tags( $args['lock_text'] ); if ( !is_user_logged_in() ) { if ( $args['show_lock'] == 'no' ) { @@ -202,7 +202,7 @@ class UM_Shortcodes { $ultimatemember->shortcodes->load_template( 'login-to-view' ); } } else { - echo do_shortcode( $this->convert_locker_tags( $content ) ); + echo do_shortcode( $this->convert_locker_tags( wpautop( $content ) ) ); } $output = ob_get_contents();