I am currently building a React/Redux theme for WordPress using the WordPress API. I need to add Page Templates to my theme. I can do this by creating almost empty files like:
<?php
/* Template Name: My Template */
?>
But I would like to create these 'Page Templates' programmatically.
The functionality I required is to be able to select a 'Page Template' inside the WordPress CMS and have this come down on the API. This functions as expected if the 'Page Templates' are created as above.
Is this possible?