How to use template_include hook with form submission?

It turns out that $wp->query_vars[“post_type”] contains the data I need, regardless of whether the request method is GET or POST. namespace mynamespace; class MyPlugin { public static function template_include($template) { global $wp; if ($wp->query_vars[“post_type”] == ‘thing’) { return plugin_dir_path( __FILE__ ) . ‘templates/thing.php’; } return $template; } } add_filter(‘template_include’, ‘\mynamespace\MyPlugin::template_include’); Also, it appears that the … Read more