I need to edit a field in buddypress profile and i kind of found a way to do it (the field is updated every time i run the code). But i put the code in bp-custom.php and every time I let this file on the hosting, the code logs out users.
<?php
function is_user_logged_in() {
$current_user = wp_get_current_user();
$date = '2018/08/01';
xprofile_set_field_data('292', $current_user->ID, $date);
}
?>
I can't find something wrong with this code, but also, i don't know php very well..