[buddypress-dev] Suggestion to add filter when rendering profile field values

phlux0r phlux0r at gmail.com
Sat Sep 13 06:18:01 GMT 2008


Hey Andy,

a bit of background for the suggestion: one of our profile fields is a 
URL to an external website. Currently there's no way to render this 
field with a link when someone enters a URL so I thought that if would 
be cool if the bp_the_profile_field_value() function would add a filter 
whereby users could add their own filter processing functions to mangle 
the output (like I've done in my hack below...). So I've added the 
filter as shown:

....
    // HACK added filter here for custom processing
    $field->data->value = apply_filters('bp_render_field_value', 
$field->data->value);
    // end HACK
    if ( BP_FRIENDS_IS_INSTALLED )
        echo stripslashes($field->data->value);
    else
        echo stripslashes($field->data->value);
}


This allows me to run a custom function and render my URL nicely...

Regards,
Robert


More information about the buddypress-dev mailing list