fix(local-fields): cascade remove on group delete - #524
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 |
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.