Hi there, I really like the ‘To/from Values’ custom field. Thanks for adding this to the list of field types, it works really well!
I am using the Enhanced Member Cards to add more profile information to the members list.
Unfortunately the To/From Values custom field only display the title, but not the numeric values, only a little dot.It seems like it is not accepted by other plugins using these fields, as a genuine custom field.
The question is, where the issue lies?
Regards
CarstenHi Carsten,
Thank you for posting.It has most probably to do with the difference between bp_profile_data and xprofile_get_field_data s used.
Please allow me to use this field today and regenerate the issue. I will post a solution later today.
Thank you
BrajeshHi Carsten,
I have looked at it now and I can see the issue. The problem lies that the xprofile_get_field_data ad the other method passes individual value to display filter while the display filter expects array.A simple solution for now will be use it like this
echo join( '-', (array) xprofile_get_field_data( 'Field Name', bp_get_member_user_id() ) );
Please change the field name with actual field name and it will work.
Regards
BrajeshThank you. Please do let me know how it goes.
Regards
BrajeshHi Carsten,
If you can tell me where you want to show it I can help. The above function needs user_id and the function I am using is for BuddyPress member loop.
There are multiple ways to add code. I had assumed that you wer manually adding the above code to member loop.
Please let me know where you want to make it appear
– Member header
– or member directoryAlso, We can use field id instead of the field name if that makes sense. You can see the field id from Dashboard->Users->profile Fields page.
Regards
BrajeshHi Carsten,
If you are using bp-legacy template pack,you can use the following code in bp-custom.php or in your child theme’s functions.php
/** * Show the field in members list(directory). */ function buddydev_custom_show_field_in_members_list() { echo join( '-', (array) xprofile_get_field_data( 2374, bp_get_member_user_id() ) ); } add_action( 'bp_directory_members_item', 'buddydev_custom_show_field_in_members_list' );
If you are using the bp-nouveau, you will need to edit their members-loop.php and put the line
echo join( '-', (array) xprofile_get_field_data( 2374, bp_get_member_user_id() ) );
Regards
Brajesh
You must be logged in to reply to this topic.