Home › Forums › Add-ons › Repeater Field › add_row functions add double rows
Hi
I’m using wordpress api to add row to my repeater field ‘car’ it belongs to user
i write functions well and it add rows but it add it double but when i but uri in browser it work will and row one time but when using api it add it double
thanks in advanced
Kindly share a copy of the code that you have so far so that we can be in a position to help.
Thanks.
I am having the same issue and no explanation, it was working and suddenly started creating double entries for the repeater field. I have registered license for the plugin. Please advice.
This is my code
// Target form and add row
function set_structure_note( $entry, $form ) {
$structure_note = rgar( $entry, ‘1’ );
$note_user = rgar( $entry, ‘4’ );
$row = array(
‘structure_note’ => $structure_note,
‘structure_author’ => $note_user,
);
add_row(‘structure_notes’, $row);
};
This is my code
// Target form and add row
function set_structure_note( $entry, $form ) {
$structure_note = rgar( $entry, ‘1’ );
$note_user = rgar( $entry, ‘4’ );
$row = array(
‘structure_note’ => $structure_note,
‘structure_author’ => $note_user,
);
add_row(‘structure_notes’, $row);
};
My <p style=”font-size:1px”>pintodown </p>
downloader site also works with the same pattern as yours
Hi @germanpc
That looks like a Gravity Forms function, is that correct? If so, does the form get triggered multiple times?
Can you add a simple debug line to the function and see if that gets repeated? I sometimes add a snippet to send myself an email. I include the data fields to ensure they contain the info, if the function then fired twice, you’d get two emails, so would then know to check GF rather than ACF
The topic ‘add_row functions add double rows’ is closed to new replies.
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.