Support

Account

Home Forums Feature Requests Function to delete groups added programatically Reply To: Function to delete groups added programatically

  • Actually, to remove fields too:

    
    $group_key = 'group_foo';
    
    $fields = acf_get_local_fields( $group_key );
    
    foreach ( $fields as $field ) {
    	acf_remove_local_field( $field['key'] );
    	acf_get_local_store( 'fields' )->remove( $field['key'] );
    }
    
    acf_remove_local_field_group( $group_key );
    acf_get_store( 'field-groups' )->remove( $group_key );