Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to get rid of autolinking on profile fields


yu
Participant

@gerbilo

i’ve found this function –

function xprofile_filter_link_profile_data( $field_value, $field_type, $field_id ) {
if ( $field_type == 'datebox' )
return $field_value;

if ( !strpos( $field_value, ',' ) && ( count( explode( ' ', $field_value ) ) > 5 ) )
return $field_value;

$values = explode( ',', $field_value );

if ( $values ) {
foreach ( $values as $value ) {
$value = trim( $value );

if ( count( explode( ' ', $value ) ) > 5 )
$new_values[] = $value;
else
$new_values[] = '<a href="' . site_url() . '/' . MEMBERS_SLUG . '/?s=' . $value . '">' . $value . '</a>';
}

$values = implode( ', ', $new_values );
}

return $values;
}
add_filter( 'bp_the_profile_field_value', 'xprofile_filter_link_profile_data', 2, 3 );

so EVERY field is ‘link’ field.. i think this is not so good ;/

next stape i think should be creation of new field_types, and applying filters to this field_types in this function. but where are this types and how to create new ones i don’t know..

Skip to toolbar