I see plugins where users can override the plugin templates by creating files inside of their own theme folder, how does this work?
Is this a built-in part of wordpress or does it have to be written in?
I see plugins where users can override the plugin templates by creating files inside of their own theme folder, how does this work?
Is this a built-in part of wordpress or does it have to be written in?
You must be logged in to post a comment.
You have to write it yourself. Check out the way WP e-commerce does it:
First, the function to “register” the theme files.
And then the function to find a theme file:
In an init hook, the plugin registers all the theme files that it needs using wpsc_register_theme_file():
And then when the file is actually needed, they call wpsc_get_template_file_path():
Obviously the code would look different for your plugin, but the principles should be the same.