I want to overwrite a theme page using my custom wordpress plugin , i tried to add filter but without result , i don't want to change directly on the theme because it's bad idea for every developer. this is my plugin code i added a filter to check pages
public function __construct(){
add_filter('theme_file_path','customize_theme_pages', 99, 2 );
}
and i tried to replace theme page with my custom page like that
public function customize_theme_pages($path, $file = ''){
if( 'woocommerce/checkout--/form-checkout.php' === $file ) {
return plugin_dir_url( __FILE__ ).'inc/form-checkout.php';
}
return $path;
}
it seems logical solution for me , but there is no changes in my site