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!