I have a group called “documents” with a sub group called “document_1” that has a few fields including “title”. When I use the loop to access the sub fields everything works fine. When I try to delete or update a sub field or the entire group nothing happens.
$group_id = 1409;
$doc_id = 'document_1';
if( have_rows('documents', $group_id) ) {
while( have_rows('documents', $group_id) ) {
the_row();
if( have_rows($doc_id, $group_id) ) {
while( have_rows($doc_id, $group_id) ) {
the_row();
update_sub_field('title', '', $group_id);
the_sub_field('title');
}
}
}
}
The field shows with “the_sub_field(‘title’);” but update or delete “_sub_field(‘title’);” does nothing. I have also tried using the keys. I would like to delete the entire sub group “document_1” but I cannot alter anything. What am I doing wrong here?