diff --git a/includes/core/class-profile.php b/includes/core/class-profile.php index 18dd2c53..1cca4a70 100644 --- a/includes/core/class-profile.php +++ b/includes/core/class-profile.php @@ -197,46 +197,46 @@ if ( ! class_exists( 'Profile' ) ) { return $this->active_subnav; } - /*** - *** @Show meta in profile - ***/ + /** + * Show meta in profile + * + * @param array $array Meta Array + * @return string + */ function show_meta( $array ) { $output = ''; - if( isset( $array ) ){ - foreach( $array as $key ) { + if ( ! empty( $array ) ) { + foreach ( $array as $key ) { $data = ''; - if ( $key && um_filtered_value( $key ) ) { + + if ( $key ) { if ( isset( UM()->builtin()->all_user_fields[ $key ] ) ){ $data = UM()->builtin()->all_user_fields[ $key ]; } - if ( isset( $data['icon'] ) ) { - $icon = $data['icon']; + $data['in_profile_meta'] = true; + + $value = um_filtered_value( $key, $data ); + if ( ! $value ) + continue; + + if ( ! um_get_option( 'profile_show_metaicon' ) ) { + $icon = ''; } else { - $icon = ''; + $icon = ! empty( $data['icon'] ) ? '' : ''; } - $data['in_profile_meta'] = true; - - $icon = ( isset( $icon ) && !empty( $icon ) ) ? '' : ''; - - if ( !um_get_option('profile_show_metaicon') ){ - $icon = ''; - } - - $value = um_filtered_value( $key, $data ); - $items[] = '' . $icon . $value . ''; $items[] = '•'; - } } } + if ( isset( $items ) ) { - array_pop($items); - foreach( $items as $item ) { + array_pop( $items ); + foreach ( $items as $item ) { $output .= $item; } } diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php index 87238bd1..664e863b 100644 --- a/includes/core/um-filters-fields.php +++ b/includes/core/um-filters-fields.php @@ -115,7 +115,7 @@ /*** *** @urls in description ***/ - add_filter('um_profile_field_filter_hook__description', 'um_profile_field_filter_hook__description', 99, 2); +/* add_filter('um_profile_field_filter_hook__description', 'um_profile_field_filter_hook__description', 99, 2); function um_profile_field_filter_hook__description( $value, $data ) { if ( isset( $data ) && isset( $data['html'] ) && $data['html'] == 1 ) @@ -126,7 +126,7 @@ $value = preg_replace('$(www\.[a-z0-9_./?=-]+)(?![^<>]*>)$i', '$1 ', $value." "); return $value; - } + }*/ /*** diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index dd52b6e5..d718bc6f 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -509,13 +509,17 @@ return $value; } - /*** - *** @Get filtered meta value after applying hooks - ***/ + /** + * Get filtered meta value after applying hooks + * + * @param $key + * @param bool $data + * @return mixed|string|void + */ function um_filtered_value( $key, $data = false ) { $value = um_user( $key ); - if (!$data) { + if ( ! $data ) { $data = UM()->builtin()->get_specific_field( $key ); } diff --git a/templates/members-grid.php b/templates/members-grid.php index f1846352..21c7a625 100644 --- a/templates/members-grid.php +++ b/templates/members-grid.php @@ -53,9 +53,10 @@ um_fetch_user( $member ); foreach( $tagline_fields as $key ) { - if ( $key && um_filtered_value( $key ) ) { + if ( $key /*&& um_filtered_value( $key )*/ ) { $value = um_filtered_value( $key ); - + if ( ! $value ) + continue; ?>
@@ -77,9 +78,10 @@