Trying to display a profile field on the site
-
I would like to display profile fields on different parts of the site.
I read that BP comes with this function:
https://codex.buddypress.org/developer/function-examples/bp_profile_field_data/I created a shortcode in my functions.php file:
/* Dislay BP field */ add_shortcode('bp_field_display', 'bp_profile_field_data');
Then went and added this shortcode to one of my pages:
[bp_field_display field="Register As"]
I expected that it would show me the value of the field I have on my profile called Register As. I didn’t specify a user ID so it should return mine since I’m logged in.
Instead, I got blank, nothing displayed at all.
Any idea what I’m missing? I’m open to other suggestions but thought that making this shortcode wouild be the most direct and straight forward way.
- You must be logged in to reply to this topic.