Instead of relying on the field name, try the field id instead:
`bp_profile_field_data( ‘field=1′ );
// 1 = your field id
`
You can find the field id by hovering over the “Edit” or “Delete” button of the field name on the Profile Field Setup screen.
Hi r-a-y,
Good suggestion. This worked perfectly for the single members page. However, I’m still having the same problem on the Member Directory page… This returns nothing:
`
bp_get_member_profile_data( ‘field=17′ );
`
Alrighty, I figured it out!!
So, it looks like the function “bp_get_member_profile_data”, which is suggested for use on the members-loop page, doesn’t work with field IDs, nor accents, nor apostrophes. To get around this, I used the function that is used in member-header.php (bp_profile_field_data), which does accept field IDs, but specified the user. Here was the final code I used:
`bp_get_profile_field_data( ‘field=17&user_id=’ . bp_get_member_user_id() );`
Hope this helps somebody!
i think it would be better that you code your php in english
The output with accent is ok without hacking on
See here where is a demo field with many acdcented and special characters, without touching the core code.
http://bp-fr.net/members/admin/profile/public/
Hi Chouf1,
Perhaps you’ve misunderstood. Accented fields are not a problem to create or use if you’re using the basic template – my problems only arose when I tried to call those fields and use them conditionally in the members loop in a customized theme. So, for example , that would be equivalent to displaying the results from your “Champ supplémentaire n° 4 bis ” on this page: http://bp-fr.net/members/. I haven’t touched the core code, the modifications are in my theme files.
If you have an alternative solution though, please feel free to share it.