Support

Account

Home Forums ACF PRO Delete values fields in a group after duplicate post

Unread

Delete values fields in a group after duplicate post

  • I want to delete the field values of an acf group after duplicating the custom post.
    Some groups of fields must have the same values but the other groups must have no more values (radiobox, text field, select fields, etc. in an acf group).

    I have try two solutions but that’s doesn’t work.

    
    $my_group = get_field("group_name", $new_post_id);
    delete_field($my_group['my_field_name']);
    

    –> get_field(“group_name”…) return the right value in my var_dump
    –> delete_field return false in my var_dump

    OR just the delete_field/delete_sub_field with the field name.

    How can I have reset all the values in a group acf field ?
    Thx

Viewing 1 post (of 1 total)

The topic ‘Delete values fields in a group after duplicate post’ is closed to new replies.