Support

Account

Home Forums ACF PRO Doing multiple add_row() is slow

Unread

Doing multiple add_row() is slow

  • I’m trying to do ~200 add_row()’s in a repeater field using the following code, but it times out after a few minutes having added approx half. Any better way to go about it?

    // Array with import data
    $rows = array
    (
    array(1,2,3),
    array(1,2,3),
    array(1,2,3)
    );

    // Loop to add
    foreach ($rows as $row) {
    $row = array(
    ‘value1’ => $row[0],
    ‘value2’ => $row[1],
    ‘value3’ => $row[2]
    );

    add_row(‘repeater_field’, $row, 40);
    }

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.