I'm developing a plugin that needs to create a page template that uses any theme's 'page.php' file. The intent is to read the source code of that theme's page.php, modify it to add additional functions, and store the modified template file in the plugins folder. The new template will then be made available on a page's 'template' dropdown (using the 'template_include' filter as described here).
The new template needs to add additional plugin scripts ('includes'), and will have a shortcode that will insert a form at the shortcode's location.
Since all themes have their own version of a 'page.php' file, I need to use the structure of the theme's page.php file (with all it's CSS and whatever content), so that using the new template on a new page will result in a page that matches the theme's 'look'.
Is there a function that will figure out the page.php template file?
Or is there a way that a shortcode can add 'includes' to a page?