Repository navigation
fix(local-fields): cascade remove on group delete - #524
faisalahammad wants to merge 1 commit into
Conversation
When acf_remove_local_field_group() ran, it removed the group from the local-groups store but left its fields orphaned in local-fields. Orphaned fields remained discoverable by key/name lookups. New _acf_cascade_remove_local_fields() helper recursively queries by parent key and removes each child field, including nested sub-fields under repeaters. Both data entries and name aliases are cleared. Fixes WordPress#458
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
CI check note — pre-existing WP trunk flakeThe only failing CI check on this PR is
The cascade helper Recommendation: treat |
|
Thanks for the contribution and the effort here! 🙏 A heads-up on how this repo works: a large part of SCF's codebase (field types, Flexible Content, Blocks v3, local fields, forms, value formatting, and most of includes/ and assets/src/js/) is regularly synced from an upstream codebase. Any change we make there, whether a bug fix or a new feature, gets overwritten or causes hard merge conflicts on the next sync. That includes features behind a beta flag. Fixes for those areas arrive through the sync itself, so we can't accept PRs that touch that code, even good ones. |
acf_remove_local_field_group()removed the group from local-groups but left its fields orphaned in the local-fields store. Orphaned fields remained discoverable by key/name lookups after their parent group was gone.New
_acf_cascade_remove_local_fields()helper recursively queries by parent key and removes each child field, including nested sub-fields under repeaters. Both the data entry and name alias are cleaned up per field.Closes #458
Use of AI Tools
This PR was developed with AI assistance. All generated code has been reviewed, tested, and verified by the author.