I’ll try and make this as simple as possible.
I have repeater fields for every user under “User Role – is equal to – all”.
When a new user registers, then registration page /wp-login.php?action=register
shows these fields, even though no user is logged in.It shows them inbetween the submit button and the email box.
If I add a rule to hide these fields on the registration page such as “User Form – Is Not Equal To – Register”, then the fields don’t show.
However, if I try to run any php scripts on the new user account which involve repeater fields they do not work.
For example, the new user’s id is ‘6’:
$field = get_field_object(‘fieldname’, ‘user_’.’6′);
echo $field[‘key’];
Will not show anything. However if I change the user to a user which was created while the fields were showing on the registration form, then it will work.
For user 6, the bugged user, I can still use update_field etc, but when it comes to repeater fields it all goes dead.
It feels as though the fields displaying on the registration page somehow initialise the user for these fields and if I don’t show them, then I can’t retrieve or modify the repeaters fields via php scripts.
The repeater fields still work manually from the profile of the user, but even after updating the profile in wordpress with changes, the repeater fields still do not respond to any php scripts.
Can you help me understand what the problem is?