WordPress / WordPress/secure-custom-fields
acf_remove_local_field_group() leaves the group's fields registered (orphans in local-fields store)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 131
- Forks
- 64
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
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).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in includes/local-fields.php:283 and read the reproduction in tests/php/includes/test-local-fields.php::test_remove_local_field_group_leaves_fields_registered. Determine whether removing a group should recursively remove its child and sub-fields or document the asymmetry. Done when the orphan lookup behavior is resolved and the reproduction test reflects the intended result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100