Home › Forums › Add-ons › Repeater Field › Programmatically updating repeater fields › Reply To: Programmatically updating repeater fields
We’ve also tried your code snippet (outside of any function) in functions.php, and it works just fine there as well.
We’re trying to now call the update_field functionality from functions.php itself by putting it within its own function, that we could then call outside of it. Something like this would go in functions.php:
function update_repeater_field($field_to_update, $value, $post) {
update_field($field_to_update, $value, $post);
echo "function update_repeater_field triggered.<br/><br/>";
}
add_action('acf/init', 'update_repeater_field', 10);
And then we would call update_repeater_field($field_to_update, $value, $post);
from our plugin. No success yet, the plugin sees the function as undefined, but theoretically that functionality should work, correct?
Thanks again for your continued help!
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.