I am working on a plugin that changes the response for 404 pages so it issues HTTP status 200 instead of 404.
I already have the status change working using code like this:
function HTTP404Template()
{
return __DIR__.'/404_template.php';
}
add_filter( '404_template', 'HTTP404Template');
Then the 404_template.php has code like this:
<?php
status_header('200');
add_filter( 'wp_robots', 'wp_robots_no_robots' );
get_header();
get_footer();
?>
Although this works, it shows the current theme template defined by another plugin, but it does not show the 404 page of that theme?
How can I change the output of a 404 to make the HTTP status be 200 and still show the current theme 404 page?