- fixed issue #346 with encode Biography field;

This commit is contained in:
nikitozzzzzzz
2017-12-07 18:42:14 +02:00
parent 3abe1ee0fa
commit ba02dd61fc
4 changed files with 38 additions and 32 deletions
+22 -22
View File
@@ -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'] ) ? '<i class="' . $data['icon'] . '"></i>' : '';
}
$data['in_profile_meta'] = true;
$icon = ( isset( $icon ) && !empty( $icon ) ) ? '<i class="'.$icon.'"></i>' : '';
if ( !um_get_option('profile_show_metaicon') ){
$icon = '';
}
$value = um_filtered_value( $key, $data );
$items[] = '<span>' . $icon . $value . '</span>';
$items[] = '<span class="b">&bull;</span>';
}
}
}
if ( isset( $items ) ) {
array_pop($items);
foreach( $items as $item ) {
array_pop( $items );
foreach ( $items as $item ) {
$output .= $item;
}
}
+2 -2
View File
@@ -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', '<a target="_blank" href="http://$1">$1</a> ', $value." ");
return $value;
}
}*/
/***
+8 -4
View File
@@ -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 );
}
+6 -4
View File
@@ -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;
?>
<div class="um-member-tagline um-member-tagline-<?php echo $key;?>"><?php echo $value; ?></div>
@@ -77,9 +78,10 @@
<div class="um-member-meta <?php if ( !$userinfo_animate ) { echo 'no-animate'; } ?>">
<?php foreach( $reveal_fields as $key ) {
if ( $key && um_filtered_value( $key ) ) {
if ( $key /*&& um_filtered_value( $key )*/ ) {
$value = um_filtered_value( $key );
if ( ! $value )
continue;
?>
<div class="um-member-metaline um-member-metaline-<?php echo $key; ?>"><span><strong><?php echo UM()->fields()->get_label( $key ); ?>:</strong> <?php echo $value; ?></span></div>