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

    • kamy

    • August 7, 2019 at 10:08 pm

    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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.