
Hello All,
I am having issues with adding row (add_sub_row) to a repeater within a repeater.
My setup is:
‘release_tracks’ Repeater field
-‘track_credits’ Repeater field
–‘track_credit’ Post Object field
–‘track_credit_text’ Text field
–‘track_credit_role’ Text field
$current_row = array('track_credit'=>0,'track_credit_text'=>$track_extra_artist_name, 'track_credit_role'=>$track_extra_artist_role);
add_sub_row( array('release_tracks', $trow, 'track_credits'), $current_row, $release_postID);
$current_row = Array ( [track_credit] => [track_credit_text] => Dan O Stofels [track_credit_role] => Recorded By, Mixed By )
$trow = 3
$release_postID = 7153 (the post id being updated)
I run this but no rows are added. echoing the add_sub_row statement gives a ‘1’ meaning the row should be there, but its not.
I can add a row from the Admin section and it shows fine and appears in the database. I run the script again and it outputs a 2, meaning there should be 2 rows, but only the one I put in the Admin is there.
Any suggestions would be greatly appreciated. Everything else on this page is working but this.
THANKS!!
Just wanted to add since I’ve still been attempting to solve this.
I was able to get the update_sub_rows to work on it’s own outside of the rest of my script.
It seems to stop working though once I put an IF statement before it.