Support

Account

Home Forums Add-ons Repeater Field Problem with add_row in foreach

Solved

Problem with add_row in foreach

  • Hi,

    I’m trying to add rows to a existing repeater, but my code only creates one row with the last values from the value source.

    
    foreach ($variable as $key => $value) {
    	$row = array(
    		'field_5efcd43d4b9ba' => $value->name,
    		'field_5efcd6204b9bc'   => $value->id,
    		'field_5efcd63b4b9bd'  => $value->url,
    		);
    	add_row( 'field_5efcd4124b9b9', $row, $post_id );
    }
    

    Thanks in advance,
    Alina

  • Edit

    I don’t know why but it’s working now.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Problem with add_row in foreach’ is closed to new replies.