<?php

// my custom type filter
function my_insert_template ($template, $type, $slug='content', $name='') {
	// first make sure it's mine
	if ('mytype' == $type) {
		// make sure found template doesn't already do it
		if (false === strpos($template, $type)) {
			// check my plugin directory for the file (just to be safe)
			$path = dirname(__FILE__) . "/templates/$slug-$type.php";
			if (file_exists($path)) {
				$template = $path;
			}
		}
	}

return $template;
}

add_filter('get_custom_template_part', 'my_insert_template', 10, 4);
