I am writing a plugin which requires Page Templates to be dynamically adapted (by plugin settings) and then loaded into the WordPress drop down list. I imagine there is a nice way of inserting this kind of data into the page cache, but my programming is not up to this!
Any ideas?
Here is my code solution (inspired by Tom McFarlin).
This is designed for a plugin (the template files are searched for in the root directory of the plugin). This can be changed if desired – check out my full tutorial http://www.wpexplorer.com/wordpress-page-templates-plugin/ for greater detail on this solution. These files are also in exactly the same format as if they were to be included directly in a theme.
To customise, simply edit the following code block within the __construct method;
Full code;
Check out my tutorial on this for more info.
http://www.wpexplorer.com/wordpress-page-templates-plugin/
I hope this helps you in what you want to do 🙂