I would like to override the Wordpress core function locate_template().
I want the function to also search an additinal plugin directory for a template file.
I don't see any filters inside the function, and also no check if the functions exists.
Maybe someone has a better solution for this.
What I'm trying to create is a grandchild theme as a plugin, and I have it worked for regular theme files but not for overriding get_template_part() and locate_template() functions.
For future clearance my website wil look inside the child theme folder for the file if it is not there it will look at the plugin folder and if it is not there it will look inside the parent theme and then the original Wordpress file.
So I build in an extra layer.