OTYS Locate template filter

The OTYS locate template filter can be used to change the locate template logic of the plugin. This way you can change what template gets loaded at any point in the plugin.

/**
 * @param string $path The entire path, plus template name currently being loaded
 * @param string $template The template file being requested
 * @return string The path to the template file
 */
add_filter( 'otys_locate_template', function($path, $template) {
    // Custom logic to provide an alternate path

	// i.e. chaange the path to a specific template
	if ($template === 'vacancies/vacancies-detail.php') {
		return 'my_custom_dir/' . $template;
	}

    return $path;
}, 10, 2 );