Problem:
How can I update or create Repeating fields using WordPress's API to manipulate meta fields (get_post_meta/update_post_metae/add_post_meta)?
Solution:
Toolset doesn't offer a specific API for this, and our Support Guidelines don't allow direct support on such custom code, we can, however, give an example that will help understand how repeating fields (not repeatable field groups, but repeating fields) can be retrieved and updated.
With repeating fields we have meta key, meta value, and the position of each of the values, to consider in our code.
To update, or post such fields, you need not only to pass an array of those values to the field but also the position of each item in the repeating field.
Below link holds a full example code, that can be used as a starting point for further customization.
Relevant Documentation:
https://kb.onthegosystems.com/code-snippet/get-and-post-repeating-fields-correctly-persisting-the-order/
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
Dieses Thema enthält 2 Antworten, hat 2 Stimmen.
Zuletzt aktualisiert von vor 5 Jahren, 3 Monaten.
Assistiert von: Beda.