Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function huddle_bp_get_the_profile_field_value( $value, $type = '', $id = '' ) {
- global $field;
- if( substr_count( strtolower( $field->name ), 'twitter' ) ) {
- if( !substr_count( $field->data->value, 'twitter.com' ) ) {
- $value = 'http://twitter.com/' . $value;
- }
- } elseif( substr_count( strtolower( $field->name ), 'about' ) ) {
- } else {
- $values = explode( ',', $value );
- if ( $values ) {
- foreach ( (array)$values as $value ) {
- $value = trim( $value );
- // If the value is a URL, skip it and just make it clickable.
- if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) {
- $new_values[] = make_clickable( $value );
- } else {
- if ( count( explode( ' ', $value ) ) > 5 ) {
- $new_values[] = $value;
- } else {
- $new_values[] = '<a href="' . site_url( bp_get_members_root_slug() ) . '/?s=' . strip_tags( $value ) . '" rel="nofollow">' . $value . '</a>';
- }
- }
- }
- $value = implode( ', ', $new_values );
- }
- }
- return $value;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement