I have a plugin template that I need to overwrite but I need to be able to put the updated file in my theme to avoid changes getting overwritten by updates.
The file is located at '/wp-content/plugins/newspack-blocks/src/blocks/homepage-articles/templates/article.php' I have tried putting the same path in my theme but that doesn't seem to work not sure if there is a proper way of doing this or maybe some sort of function that can tell Wordpress which file to use?
locate_template
to add this as a fallback for when the file isn't in the theme but how you would do that i'm not 100% on the particulars. You would need to explicitly code in support, as Jacob said there's no generic PHP file replacement mechanism you can use. WooCommerce does something like this