Tribe__Image__Plus__Main::template( string $template )
Loads theme files in appropriate hierarchy: First the child theme, then the parent template, and finally plugin resources. Will look in the image-widget/ directory in a theme, the views/ directory in the plugin.
Contents
Parameters
- $template
-
(string) (Required) Template file to search for.
Return
(template) path
Source
File: src/Tribe/Main.php
public function template( $template ) {
// Whether or not .php was added.
$template_slug = rtrim( $template, '.php' );
$template = $template_slug . '.php';
if ( $theme_file = locate_template( array( "image-widget/{$template}" ) ) ) {
$file = $theme_file;
} else {
$file = "{$this->plugin_path}src/views/{$template}";
}
return apply_filters( 'tribe_image_plus_template_' . $template, $file );
}