Tell us what you are trying to do?
I am trying to use Ajax/php to update a repeating usermeta field
Is there any documentation that you are following?
No, just custom php programming
Is there a similar example that we can see?
What is the link to your site?
local-vacancies.dev.cc (is a local site)
Hi,
Im building a job search portal for users and am looking for a little help in saving job vacancies to user accounts.
Ive created a simple repeater user meta field which I can programmatically update via Ajax, however it doesnt add a NEW line to the repeater, it only overwrites the initial value in the repeater field.
I am using the default wordpress update user meta code (see below)
$saved = update_user_meta( $user_id, 'wpcf-js-saved-vacancy', $job);
Is there way to increment or add a repeater user meta field via php as my users will not have access to the admin of the site?
I should point out, I cannot use post relationships as the site is JavaScript driven and I am saving urls to the user meta and not posts.
My issue is resolved now. Thank you!
I realised that I was using update_user_meta, when in fact I should have been using add_user_meta to add the saved job to the user, and delete_user_meta to delete the job from the repeater.