Hi Ethan,
Please put this code in your bp-custom.php
/** * Force Userinsights plugin to use age instead of date. */ add_filter( 'usin_user_profile_data', function ( $user ) { $filed_id = 25; // please change with your birthdate field id. $key = "bxp_{$filed_id}"; if ( $user->{$key} ) { $user->{$key} = xprofile_get_field_data( $filed_id, $user->ID ); } return $user; } );
and make sure to update the field id with the correct field id.
It will fix the issue. Please let me know if it works for you or not?
PS:- This is happening due to incorrect implementation of userinsights and I will recommend that you request them to fix it.
Regards
BrajeshIt does not work i switched the field id to the field we use and the date stays the same it does not pull the age any ideas or would you like screenshots?
I reached out to user insights already and now again with your information i bet they will not help us but will post info if they do.
Hi Ethan,
Please share the screenshot showing the location. I have re-checked and It is working fine when you click on a user’s name in the list and their data view is shown.Regards
Brajeshhttps://postimg.cc/mtxpF6Rj –> Showing Date instead of age
https://postimg.cc/w1nQS1vV –> Showing code in bp-custom file.changed the field id I noticed its spelled filed instead of field but upon changing that not difference either.
So now I see the code you provided an update on the user insights profile field but not on the search/table view if you understand me. The first screenshot above is where we want it to show. this is were the code is currenlty changing: https://postimg.cc/hQVk7kYF
Hi Ethan,
Thank you for the reply.I did not fix this screen. I fixed the screen where you see an overview of user details after you click on user name in this list.
I will need to re-check if this field is modifiable from external code.
Regards
BrajeshI see, we were replying at the same time. You found it correctly. I had fixed that screen. I will re-check and get back to you if this field is changeable on the filter screen or not.
Regards
Brajesh
You must be logged in to reply to this topic.