HEX
Server: Apache
System: Linux webd004.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/frenchy/refonte2023/wordpress/wp-content/plugins/ova-dir/inc/class-ova-templates-loaders.php
<?php

if ( !defined( 'ABSPATH' ) ) {
	exit;
}

class OVADIR_templates_loader {
	
	/**
	 * The Constructor
	 */
	public function __construct() {
		add_filter( 'template_include', array( $this, 'template_loader' ) );
	}

	public function template_loader( $template ) {

		$post_type = isset($_REQUEST['post_type'] ) ? esc_html( $_REQUEST['post_type'] ) : get_post_type();


		if( is_tax( 'cat_dir' ) ||  get_query_var( 'cat_dir' ) != '' || is_tax( 'tag_dir' ) ||  get_query_var( 'tag_dir' ) != ''){
			ovadir_get_template( 'archive.php' );
			return false;
		}

		// Is Team Post Type
		if(  $post_type == 'ova_dir' ){

			if ( is_post_type_archive( 'ova_dir' ) ) { 

				ovadir_get_template( 'archive.php' );
				return false;

			} else if ( is_single() ) {

				ovadir_get_template( 'single.php' );
				return false;

			}
		}


		if ( $post_type !== 'ova_dir' ){
			return $template;
		}
	}
}

new OVADIR_templates_loader();