Skip to content

acf_remove_local_field_group() leaves the group's fields registered (orphans in local-fields store) #458

Description

@cbravobernal

Description

acf_remove_local_field_group() (includes/local-fields.php:283) removes only the group from the local-groups store; the fields registered under it remain in the local-fields store as orphans — still discoverable by key/name lookups after their group is gone.

Reproduction

Repro test in #450: tests/php/includes/test-local-fields.php::test_remove_local_field_group_leaves_fields_registered.

Suggested fix

Cascade removal of child fields (recursively, covering sub-fields) when the group is removed — or document the asymmetry if it is intentional.

Found during the 2026-06 test campaign (see PR #450).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Type] BugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions