Hi there we are using xprofile fields to calculate the age from the birth date. however on the backend we are using userinsights to view data and it only shows the birth date in date form not age. Can you tell me the variable used for age so i can replace it in user insights in the display methoad?
Thank you for the question.
From your screenshots, It seems the user insights has the field types hard coded. Birthday is a sub type of date and they should either add the logic for calculating age or use xprofile_get_field_data to have it automatically formatted for them.
Could you maybe elborate more on how ot use xprofile_get_field to have it automatically formatted assuming that is the easiest solution.
User Insights will not help at all.
I appreciate your kindness in helping I can even provide a suitable payment for the solution.
From your screenshot, It seems they are fetching the profile data using their own database methods and treating the field type as text for any field not matching their predefined list.
BuddyPress has an APi function for fetching a field’s data(xprofile_get_field_data). When this function is used, It fires some of the filetsr which are used by field type to format data.
I hope that helps.
It definitely shows me more insight to how these functions are working.
It still sounds a little bit out of my wheelhouse could this be something you could bill me as custom development? Or point me in the direction of a trustworthy person interested in the work?
If you can provide us a copy of userinshights, we can certainly look into it and provide a patch. I believe that the right solution will be to have a patch in the userinsights plugin to avoid it being lost in future versions.
You must be logged in to reply to this topic.