Home › Forums › Add-ons › Repeater Field › Why not a JSON field ? › Reply To: Why not a JSON field ?
I am not the developer but I know some of what went into this decision. ACF uses built in WP functions for saving data and it also allow you to use built in WP functions to get the data if you choose to do so.
If the data was stored as JSON then you could not use get_sub_field()
this function is a wrapper for built in functions like get_post_meta()
.
The decision was made so that built in WP functions can be used and also be able to know what data in belongs in each row.
ACF does what we can do using built in WP functions, it just makes it easier to build the admin fields.
ACF is also recursive, saving a sub field in a repeater works exactly the same a saving a field at the top level. If sub fields worked differently than top level fields then there would need to be different code for sub fields removing the ability to nest repeaters indefinitely.
Those are just some of the reasons
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.