tybruffy / ACF-Reusable-Field-Group

Advanced Custom Fields Plugin to reuse Field Groups
53 stars 16 forks source link

Deletes original fields!? #10

Open dsamson opened 8 years ago

dsamson commented 8 years ago

Has anyone else ran into an issue where if you delete a reusable field group that's linked to another group in the drop down... It then goes ahead and deletes ALL of the fields associated with the field group it was linked to.

After further investigation it appears to be this function in acf-reusable_field_group-v5.php Anyone know what this is suppose to be doing?

function delete_field( $field ) {

    // loop through sub fields
    if( !empty($field['sub_fields']) ) {

        foreach( $field['sub_fields'] as $sub_field ) {

            acf_delete_field( $sub_field['ID'] );

        }

    }

}
skechele commented 8 years ago

Thank you so much, I thought i was going nuts. I couldnt figure out that it was related to this plugin.

Commenting out the source code seems to fix it. It doesnt make a lot of sense to me anyway. Why would this Plugin delete a Post, it doesnt create a Post.

Did you try commenting it out? Did you run into any problems?

dsamson commented 7 years ago

Yeah, I commented out the code and everything seems to work as it should now.