Add new custom templates location?
-
Hello,
Thanks for a great plugin! For organizational purposes I would like to be able to store my custom su-templates in a directory other than the default child theme, parent theme or plugin directories. Is there a way to add a custom template location to the plugin? Something like this, in a mu-plugin file:
add_filter('allowed_template_paths', 'my_su_custom_templates_location'); function my_su_custom_templates_location($allowed_paths) { $custom_path = trailingslashit(dirname( __FILE__ ) . '/su-templates'); array_unshift($allowed_paths, $custom_path); // Add custom template path first as a higher priority to the core plugin and theme paths return $allowed_paths; }
Cheers,
/Jen
- The topic ‘Add new custom templates location?’ is closed to new replies.