Home Forums Backend Issues (wp-admin) Update_sub_field not working


Update_sub_field not working

  • 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) ) {
    			if( have_rows($doc_id, $group_id) ) {
    				while( have_rows($doc_id, $group_id) ) {
    					update_sub_field('title', '', $group_id);

    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?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.