Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Profile Field adds Award


Boone Gorges
Keymaster

@boonebgorges

Thanks for pasting up that code. I think I found the issue. It has to do with the way that content returned by bp_get_the_profile_field_name has filters applied to it, namely the filters that some profile field items into links. There are a couple ways around the problem, but the easiest is to get the data before the filters hit. Thus:

<?php if ( bp_get_the_profile_field_name() == 'Gender' ) {
global $field;
if ( bp_unserialize_profile_field( $field->data->value ) == "Male" )
echo '<img src="male.jpg" alt="male" title="Male" />';
}
?>

I didn’t experience this in my test because (I think) my field data came from a textarea rather than a radio button. But the strategy I just gave you should be safe in any case.

Hope it works!

Skip to toolbar