Apply a material function to all materials

I have a material function that I want use on all my materials. It seems inefficient to go around and manually add this to all and could be easy to forget. I wonder if there is a way to make sort of a “parent material” that all my materials inherit from? Or if there is another way to do this. I feel like it could be done with a pp-effect or a shader but I’m not sure. If its to any help it’s an effect that curves the world in the distance.