- fixed template function;

This commit is contained in:
yura_nalivaiko
2017-10-25 17:11:58 +03:00
parent e0924d4aa8
commit dee53eddd9
+4 -3
View File
@@ -210,7 +210,7 @@ if ( ! class_exists( 'UM_Functions' ) ) {
}
$located = $this->locate_template( $template_name, $path );
var_dump($located);
if ( ! file_exists( $located ) ) {
_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', $located ), '2.1' );
return;
@@ -248,10 +248,11 @@ if ( ! class_exists( 'UM_Functions' ) ) {
if( !$template ) {
if( $path ) {
$template = trailingslashit( trailingslashit( WP_PLUGIN_DIR ) . $path ) . $template_name;
$template = trailingslashit( trailingslashit( WP_PLUGIN_DIR ) . $path );
} else {
$template = trailingslashit( um_path . 'templates' ) . $template_name;
$template = trailingslashit( um_path );
}
$template .= 'templates/' . $template_name;
}
// Return what we found.
return apply_filters( 'um_locate_template', $template, $template_name, $path );