How to render a template file using shortcode inside a plugin
locate_template() only look for a specific template in themes, not in plugins, so your function wil never work. This also goes for get_template_part() which is in essence just a wrapper function for locate_template(). You will need to use funtions like file_exists() to check whether or not the required template exists and then use something like … Read more