Can't for the life of me figure out why this isn't working, I've tried like below with $val, I've tried sticking the get_user_meta into the meta_value, I've tried just adding +1 in the meta_value but no matter what it always sets the value of the meta data to the number I'm trying to increment by so if its +1 it'll be set to 1 and +4 to 4.
if(!get_user_meta(bp_displayed_user_id(), 'page_visits', true) >= 0){
update_user_meta(bp_displayed_user_id(), 'page_visits', 0);
}
$val = get_user_meta(bp_displayed_user_id(), 'page_visits', true) + 1;
update_user_meta(bp_displayed_user_id(), 'page_visits', $val);
page_vwisits
where I think you meanpage_visits
. I don't know that that will be the cause of your problem, but it can't be helping matters.