Another thing you might be running into is that you’re trying to use it on a relationship field that already has relationships, this will not work. The filter compares the old values with the new values so that it knows when relationships need to be removed and which relationships to remove. If you add this filter and then just update a post, nothing will happen because nothing has changed…..
I made a change to the script that will make it work on existing relationships fields with existing values, please read the comment in the file for more information
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users