Template_Loader::__construct()
Source
File: includes/libs/templates/template-loader.class.php
public function __construct(){ add_filter( 'template_include', function( $template ){ if ( is_embed() ) { return $template; } $default_file = $this->get_template_default_file(); if( $default_file ){ $search_files = $this->get_template_loader_files( $default_file ); $template = locate_template( $search_files ); if( !$template || VIMEOTHEQUE_TEMPLATE_DEBUG_MODE ){ if( false !== strpos( $default_file, Plugin::instance()->get_cpt()->get_tag_tax() ) ){ $cs_template = str_replace( '_', '-', $default_file ); $template = \Vimeotheque\Helper::get_path() . '/templates/' . $cs_template; }else{ $template = \Vimeotheque\Helper::get_path() . '/templates/' . $default_file; } } } return $template; } ); }