Hi guys
I’ve been coding a fake betting site and your plugin has been a massive part of that.
However I’ve run across a problem and I don’t know how to fix it.
I use many fields in the user profiles but for this example, we can just look at the bank balance of each user which is a simple number field.
I have created the field for bank balance and added its location to user profiles. However, that bank balance does not exist until a user manually presses “Update” on their profile.
Is there a way that I can define and create all of the bank balances for every user?
Would adding an account creation script that defines the variable/field when a user registers be possible and the correct way to do it?
I’m using ACF version 4. Do I need to upgrade to do this?
*Edit*
I’ve realised I can use either of these:
<?php update_field( 'testbankbalance',"15",'user_'.$user_id); ?>
<?php update_usermeta( $user_id, 'testbankbalance', "11" ); ?>
This successfully alters the value in a field in the user profile of the selected user.
However, I need to do this for a repeater field. Is it possible to do this using the update metadata method? Right now my repeater fields show no rows when I try to loop through them. I need to define the repeater fields for every user.