AdvancedCustomFields / AdvancedCustomFields/acf
Updating Repeater Sub Field Value based on Unique ID
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 945
- Forks
- 197
- PR merge metrics
- No merged PRs in 30d
Description
Is it possible to update a sub field in a repeater field set by using the unique_id that belongs to the repeater field set, not the row count typically used in "update_sub_field"?
Since the order of the array can change, based on the sorting in the admin area, i'd like to be able to do this if its possible, say increment a repeater sub field, having the unique_id?

Like in the image / example above, to use the Unique_ID of the sub field to update the value of the up count vote to say increment by 1 using ajax or something along those lines.
Since the sort order would change the row count and render using the sort / row count in the array useless. Might ask how? The row count becomes useless in a situation like this since a viewer may load a page, admin changes sort order, then when ajax is fired at a later time when front-end elements are already loaded, it would end up updating the wrong field.
In PHP and mysql this is very trivial, but it being in the wordpress environment, need to be cautious. If you have any insight on how this maybe possible i'd greatly appreciate it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files or tests. Start by tracing the existing update_sub_field API and how repeater unique_id values are handled, then clarify whether an AJAX request can target that identifier safely. Done means a documented, supported way to update the intended sub field after admin reordering, with the expected behavior defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, wordpress
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100