Skip to content

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

@cbravobernal

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions