|Reported by:||wonderboymusic||Owned by:|
To anyone who uses "plugins" to package components that contain UI elements, this might be a no-brainer. Themes have a dead simple way of loading template parts from anywhere without having to resolve paths: get_template_part(). Because the arguments passed are arbitrary strings, it's easy to reference templates in deep directories by doing get_template_part( 'artist/reviews', 'main' ) and the like.
This is all well and good, but it would awesome to be able to grab "template parts" from plugins as well, from anywhere, without having to resolve path dependencies on your own.
I attempt to solve this with get_plugin_part()
Example for a plugin called JJJ, which has a template called cat-meow.php in a folder called views:
get_plugin_part( 'jjj', 'views/cat', 'meow' );