I have implemented inside my plugin this hook to change the single template for custom post type (I do not want it to be in the child theme, just in my plugin) and it works just fine.
Now I want to implement content-single.php inside my plugin. How can it be done? This is the code that implements the custom template inside the plugin:
//Template fallback
function get_custom_post_type_template($single_template) {
global $post;
if ($post->post_type == 'my-custom-post-type') {
$single_template = dirname( __FILE__ ) . '/single-my-custom-post-type.php';
}
return $single_template;
}
add_filter( 'single_template', 'my-custom-post-type' );